sanniassin / react-input-mask

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

Loses focus when used as redux state #223

Open GhazanfarKhan opened 4 years ago

GhazanfarKhan commented 4 years ago

Hi Can any one please look into this issue. Focus moves to end due to component re-render.

https://stackoverflow.com/questions/62823513/react-input-mask-focus-position-moved-to-end-when-use-with-redux-component-reren

hericlesbitencourt commented 4 years ago

I had the same problem, this is happening because of the underline signal ( __ ) and what I did was add the property maskPlaceholder={null} so when you loses focus (going to to another input for example) the underline mask is gone and the cursor maintains the previous state. It's working fine, at least for me.