RobinHerbots / Inputmask

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

Alternator not working in 5.0.9-beta.6 #2711

Closed fanste closed 1 year ago

fanste commented 1 year ago

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

Seems to be broken since 5.0.9-beta.3 (commit 377a8695220b28b17bb4fd0554bbbe83b96288e5). Version 5.0.9-beta.1 (commit 32dec4abd9260e484d7d95c30d8893b47b7b211f) 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.

fanste commented 1 year ago

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

luco commented 1 year ago

Same here!

RobinHerbots commented 1 year ago

Can you retry with 5.0.9-beta.7

fanste commented 1 year ago

This bug seems to be fixed.

Thanks for the fast response.