RobinHerbots / Inputmask

Input Mask plugin

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternator not working in 5.0.9-beta.6

fanste opened this issue · comments

commented

JSFiddle: https://jsfiddle.net/z3wgjdhf/1/

Seems to be broken since 5.0.9-beta.3 (commit 377a869). Version 5.0.9-beta.1 (commit 32dec4a) is working.

Mask is configured with

Inputmask({
    // complex alternator mask as optional is working as expected
    mask: '(*-******)|(*-******-**)|(*-******-**-**)|(*-******-**-**-**)|(*-******-**-**-**-**)|(*-******-**-**-**-**-***)',
    clearIncomplete: true,
    keepStatic: true
})

If you type in 7 chars (first mask), everything is just fine.
image

But if you add one more char to start the second mask (here an a), the mask gets messed up.
image
It directly jumps to the third mask and even removes some digits.

commented

Additional observation with beta.3:
If you just enter 1-1 and press backspace, the result is -1 instead of 1-.

This is also working with beta.1

Same here!

Can you retry with 5.0.9-beta.7

commented

This bug seems to be fixed.

Thanks for the fast response.