RobinHerbots / Inputmask

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

Maximum call stack size exceeded when I specified an incorrect mask in the parameters #2762

Open IuriiKin opened 6 months ago

IuriiKin commented 6 months ago

I'm using version 5.0.8

When I specified an incorrect mask in the parameters, for example: 9{,

Inputmask({ mask: "9{", clearIncomplete: true, }).mask(...)

I get an error in the console inputmask.js:2493 Uncaught RangeError: Maximum call stack size exceeded at get [Symbol.species] () at Array.slice () at eval (inputmask.js:2493:169) at y.u (inputmask.js:2496:30) at y.s (inputmask.js:2343:80) at y.o (inputmask.js:2332:47) at eval (inputmask.js:2493:156) at y.u (inputmask.js:2496:30) at y.s (inputmask.js:2343:80) at y.o (inputmask.js:2332:47)

In this case, the browser page freezes completely.

On our service, the user independently sets the mask through a text field. The user may make a mistake and enter the wrong mask.

Tell me how to make sure that the page does not freeze if an incorrect mask is entered?