sanniassin / react-input-mask

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

Cursor problem with Safari and Custom component #206

Closed dskiba closed 4 years ago

dskiba commented 4 years ago

Hi, I have tried masked input with a custom component (also with react-hook-form) and notice that in Safari (13), after change cursor moves to the end.

Heres an example https://codesandbox.io/s/new-star-rzmfb

Works well in Chrome and Firefox.

dskiba commented 4 years ago

think this is related to https://github.com/facebook/react/issues/955

dskiba commented 4 years ago

Well, I think I fixed it :D https://codesandbox.io/s/focused-kapitsa-n3u6c

should use react setState, instead of setValue from react-hook-form