use-mask-input@3.11.1
Patch Changes
-
20230ee: fix: stop
maxLengthfrom blocking input on masked fieldsA mask like
999.999.999-99keeps its literals and placeholder in the input's
value, somaxlengthcounted characters nobody typed. The browser refused
keystrokes, and inputmask copied the attribute into a validator that rejects any
buffer longer than it. AnymaxLengthat or below the masked length rejected
every keystroke, and larger values silently truncated.The attribute is now removed before the mask is applied, but only for masks that
render characters on their own. Open-ended masks such asnumeric,integer
anddecimalrender nothing while empty, so theirmaxLengthstill caps
exactly what it says it caps and is left untouched.Closes #191
-
46fb75d: fix(react-hook-form): fire
onChangeon the first select-all + delete for predefined valuesWhen a React Hook Form field had a predefined value, the mask was applied before RHF wrote that value onto the element, leaving Inputmask's internal buffer out of sync with the DOM. The first
Ctrl+A+Deletewas swallowed and did not triggeronChange. The RHF ref now runs before the mask is applied, so Inputmask is seeded with the current value and stays in sync from the start.