RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.37k stars 2.17k forks source link

Optional parts not working as expected #2710

Closed fanste closed 1 year ago

fanste commented 1 year ago

I have an mask containing optionals, like *-******[-**] and clearIncomplete = true.

My expectation is, that it either accepts a-bcdefg or a-bcdefg-hi but NOT a-bcdefg-h (last character missing).

Is this a bug or a desired behavior? Tested using the latest version from dist.

Edited on 2023-05-22.

RobinHerbots commented 1 year ago

Can you retry with 5.0.9-beta.7

fanste commented 1 year ago

Same behavior as before.

RobinHerbots commented 1 year ago

@fanste ,

I tried your mask. Initial: _-__ Type: abcdefgh => a-bcdefg-h Blur: a-bcdefg-h

The mask is visually ok, but I noticed a oncomplete is triggered, which is incorrect. Is this what you mean?

fanste commented 1 year ago

I noticed, that I missed a detail in the initial posting, sorry for that. I've edited the initial posting and added the info about clearIncomplete = true.

So in other words:

You mentioned that oncomplete is triggered which should not be the case. So i think that clear the field (=> option 1) should be the desired behavior?

RobinHerbots commented 1 year ago

@fanste ,

Version 5.0.9-beta.10 should fix the issue.