Implement integration with input mask libraries #8464
-
Is your feature request related to an issue? Please describe. Describe the desired solution Describe the alternatives you considered Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Thanks for the feature request @leonardopn react hook form is headless and that's by design, we would not directly integrate with any library however we do expose hook to integrate with the external controlled component. I remember there is a mask input in this codesandbox: https://codesandbox.io/s/react-hook-form-v7-controller-5h1q5 I am to discuss what's difficult and come up with a solution but we probably not going to a route to directly integrate with another library, in fact, it would make more sense the reverse order. |
Beta Was this translation helpful? Give feedback.
-
My example with react-hook-form + ract-imask + yup - https://codesandbox.io/s/react-hook-form-yup-react-imask-v2y1fl |
Beta Was this translation helpful? Give feedback.
-
thank you very much @regdos going to move to discussion. |
Beta Was this translation helpful? Give feedback.
-
I have exactly the same problem. I would like to integrate react-imask + react-hook-form using uncontrolled components. But this seems impossible because @bluebill1049 Could you check it? Maybe there is a way to integrate react-imask + react-hook-form using uncontrolled components? |
Beta Was this translation helpful? Give feedback.
My example with react-hook-form + ract-imask + yup - https://codesandbox.io/s/react-hook-form-yup-react-imask-v2y1fl
Works fine with one small exception - cannot be used
unmask={true}
because unmasked value is only returned to onAccept event.For onBlur value is returned always with mask.