react-maskedinput
react-maskedinput copied to clipboard
Shifting the existing input instead of rewriting -- possibly need an option
Hello !
Demo (video): http://take.ms/iJkM7
A brief description of the expectations below:
- I fill in an IBAN. It is being formatted like:
1234 ABCD EFGH 0123 - Then I move the caret to some character in the middle of masked input (let it be right after
Bsymbol ):1234 ABCD EFGH 0123.......^ - Then I press backspace and get
1234 ACDE FGH0 123......^ - After that I try to type B once again and get
123 ABDE FGH0 123instead of naively) expected1234 ABCD EFGH 0123
The settings of the field are following:
{
mask: '#### #### #### #### #### #### #### #### ##',
size: 42,
placeholderChar: ' ',
placeholderFixed: '#### #### #### #### #### #### #### #### ##',
hidePlaceholder: true,
isRevealingMask: true
},
P.S. Doing this without a placeholderFixed and a visible placeholder wont do, as IBAN is a format of arbitrary size, so when I enter something like AD12 0001 2030 2003 5910 0100 and then try to change it to like AT61 1904 3002 3457 3201 (which is also a valid IBAN) I will see AT61 1904 3002 3457 3201 XXXX where X is a placeholder char -- it won't disappear even if I clean all input.
Thanks in advance!