T
TanStack•6mo ago
exotic-emerald

Input masks

👋 Is there a recommended way to do input masks using Form? In particular, I'd like to have a date field in the dd.MM.yyyy format that auto adds the dots or jumps over them if they're input manually. We've all seen that kind of input. I've checked Maskito but it doesn't play nicely with controlled inputs - it will parse on every input and replace the value, meaning there's no way to edit an existing value in the field (deleted chars get autofilled with 0). Cheers
2 Replies
harsh-harlequin
harsh-harlequin•3mo ago
Any sugestion?
xenial-black
xenial-black•3mo ago
One way I've seen people do it is using multiple inputs. But then you have to manage the focus changes yourself. I think React-Aria is doing this for their data picker component.

Did you find this page helpful?