RobinHerbots / Inputmask

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

Optional Mask Regression #2727

Closed melloware closed 11 months ago

melloware commented 11 months ago

A Regression between 5.8 and 5.9 using an optional mask. If you toggle clearIncomplete: true and false in 5.8 clearIncomplete true still allowed the "12" because of the optional part. In 5.9 it is not and the only way to retain it is to turn clearIncomplete: false

This is a regression as its a change in behavior from 5.8.?

<input id="mask" value="12"/>
Inputmask({
  mask: '9[999]',
  clearIncomplete: true,
  keepStatic: false
}).mask(document.getElementById('mask'));

Working Fiddle: https://jsfiddle.net/okh8ewcb/1/

Broken Fiddle: https://jsfiddle.net/okh8ewcb/2/

RobinHerbots commented 11 months ago

@melloware ,

The behavior in 5.9 is actually correct and the behavior in 5.8 is wrong. (ok versioning wise, you are correct)

To have the expected behavior you can also use another mask. See jsfiddle https://jsfiddle.net/491f2370/

melloware commented 11 months ago

Awesome thank you!