sanniassin / react-input-mask

Input masking component for React. Made with attention to UX.
MIT License
2.24k stars 255 forks source link

Can we associate the mask with mask char and formatChars with each individual position. #278

Open umakanthsree opened 2 years ago

umakanthsree commented 2 years ago

I have a mask as "99/99/9999", where my

  1. Mask Char should associate first and second 9 in the mask to dd, third and fourth to mm, and rest to yyyy.
  2. Similarly formatChars should associate the first 9 as [0-3], second to [0-9], third to [0-1], fourth to [0-9], likewise.

Please help if we already have such an example available.

warsawgentleman commented 1 year ago

Maybe maskPlaceholder="dd/mm/yyyy" is what you are looking for?

briardg commented 2 months ago

Maybe maskPlaceholder="dd/mm/yyyy" is what you are looking for?

This is not working, the doc is wrong

// Will be rendered as 12/mm/yy
<InputMask mask="99/99/99" maskPlaceholder="dd/mm/yy" value="12" />

Screenshot 2024-09-19 at 17 10 46