State of alternator not reset with `clearIncomplete = true`
fanste opened this issue · comments
Tested using 5.0.9-beta.6
JSFiddle: https://jsfiddle.net/mxLs0eqj/2/
Input is configured with
Inputmask({
// complex alternator mask as optional is working as expected
mask: '(*-******)|(*-******-**)|(*-******-**-**)|(*-******-**-**-**)|(*-******-**-**-**-**)|(*-******-**-**-**-**-***)',
clearIncomplete: true,
keepStatic: true
})
If you type in 12345678
to get to the second mask and then leave the input, the input is cleared, Thats OK.
But then you can't enter a value matching the first mask until backspace is pressed. The internal state only then seems to be cleared as well and the input still expectes a value matching the second (or higher) mask. A value matching the first mask is always rejected and cleared again.
.
A not so nice workaround is to add:
, onincomplete: function() {
this.inputmask.setValue('');
}
@fanste ,
I pushed 5.0.9-beta.7
Same behavior as before. The changes in beta.7
do not fix this issue.
Hmm, isn't this a caching issue?
No, unfortunately it isn't a caching issue. I just tried in on your jsfiddle and even reloaded the page with Strg+F5.
- Hover the field. Placeholder
_-______
is shown - Focus the field. Placeholder
_-______
is shown - Enter
1234567
- Blur the field, value is accepted.
- Add
8
to the previous sequence - Blur the field, value is cleared.
- Hover the field. Placeholder
_-______
is shown - Focus the field. Placeholder
_-______-__
is shown - Enter
1234567
- Blur the field, value is cleared
- Focus the field again (
_-______-__
is still displayed) - Press backspace, placeholder changes to
_-______
. - Enter
1234567
- Blur the field, value is accepted
@fanste ,
You were right. I pushed version 5.0.9-beta.9 which should fix it. Can you have a try.
Bug is fixed with the new version. Thanks!