When using the mask "99.999.999-[99]|[aa]" with the use-mask-input library, pressing the Backspace key results in the word "Backspace" being written into the input. However, since the mask allows only 2 characters for letters, it ends up writing "Ba" or "BB".
Use the mask "99.999.999-[99]|[aa]" in an input field.
Type a valid RG number. (In Brazil some states RG has letters at the end)
Press the Backspace key.
Expected Behavior:
The Backspace key should delete the previous character, not write "Ba" or "BB" into the input field.
Actual Behavior:
Pressing the Backspace key writes "Ba" or "BB" into the input field.
Environment:
Library Version: 3.4.0
I'm using the mask with react-hook-form
This issue seems to occur specifically with masks that include optional letter characters. It prevents proper user experience by inserting unwanted characters when attempting to delete.
Description:
When using the mask
"99.999.999-[99]|[aa]"
with theuse-mask-input
library, pressing theBackspace
key results in the word "Backspace" being written into the input. However, since the mask allows only 2 characters for letters, it ends up writing "Ba" or "BB".Code Example:
Steps to Reproduce:
Use the mask "99.999.999-[99]|[aa]" in an input field. Type a valid RG number. (In Brazil some states RG has letters at the end) Press the Backspace key.
Expected Behavior:
The Backspace key should delete the previous character, not write "Ba" or "BB" into the input field.
Actual Behavior:
Pressing the Backspace key writes "Ba" or "BB" into the input field.
Environment:
Library Version: 3.4.0 I'm using the mask with react-hook-form
This issue seems to occur specifically with masks that include optional letter characters. It prevents proper user experience by inserting unwanted characters when attempting to delete.
Thank you for looking into this issue.