react-redux-form icon indicating copy to clipboard operation
react-redux-form copied to clipboard

Formatters and Parsers. Android cursor position issue

Open greghawk opened this issue 7 years ago • 2 comments

Hey David. I've seen and solved this issue in other codebases before. When using a formatter there is a timing issue with droid keypress as it is not expecting non-typed characters to be added to the input. Wanted to make sure you were aware. I can look to make a PR if i can find where to properly place the code

greghawk avatar Mar 07 '18 20:03 greghawk

Please do, that would be greatly appreciated.

davidkpiano avatar Mar 07 '18 21:03 davidkpiano

@davidkpiano I ended up having to add this. Not sure where all in the factory to add this.

onChange={e => { //this only exists for old droid issue if (typeof navigator !== 'undefined' && navigator.userAgent.match(/Android/i)) { setTimeout(() => { e.target.selectionStart = e.target.value.length; e.target.selectionEnd = e.target.value.length; }, 0); } } }

greghawk avatar Mar 10 '18 00:03 greghawk