RobinHerbots / Inputmask

Input Mask plugin

Home Page:https://robinherbots.github.io/Inputmask/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optional Mask Regression

melloware opened this issue · comments

  • Describe the bug

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/

  • Inputmask version: 5.9-beta30

@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/

Awesome thank you!