Reputation: 320
I am implementing an input, where the user should type number in the following format: 12/34/56. I have found that react-input-mask allows to do so. But my question now is how to make the mask either require the user to fully enter the number (to remove such cases 1_/3_/_5) or add zeros where the number wasn't entered.
Also, another thing I think of is to allow either one or two digits, but I haven't seen documentation on this in react-input-mask
I am willing to choose another mask library, if you know it can be done so.
Upvotes: 1
Views: 749
Reputation: 320
I figured it out. There is a property called maskChar, if you set it to null
, e.g <InputMask maskChar={null} mask="99/99/99" />
won't allow user to proceed to second number, without filling both digits.
Upvotes: 1