sanniassin / react-input-mask

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

Fix focus input when mask changes #153

Closed ngryman closed 6 years ago

ngryman commented 6 years ago

Hey,

We're using your really cool library but hit a small bug. When changing the mask of an input, the focus is given to that input on Safari only. We suspect that their selection API implementation gives the focus to the affected input, while other browser seem to do no nothing.

Adding a simple check to not change the selection when the field is not focused seems to resolve the problem.

Thanks!

ngryman commented 6 years ago

@sanniassin I had to add built files to our master because we directly depend on it while waiting for this PR. #154 comes with only the right changes. Sorry for the confusion.