Cursor doesn't keep up with typing on some Samsung Android phones
See original GitHub issueThis reproducible on my Huawei running Android 6.0, and on Samsung S8+ phones. It happens with and without type="tel"
in the <Phone>
declaration, so I don’t think it’s related to this issue.
Set the country to “UK”, and type in “077915”. The input will contain “07791 5” (with a space) and the cursor will be positioned before the 5. Typing “67890” after this results in “07791 678905” instead of “07791 567890”.
It appears that on these devices that doing a complete onChange -> setState -> render cycle results in the cursor being positioned incorrectly. Calling setState in a setTimeout callback seems to fix it.
Here’s a pull request that seems to resolve the issue on my device: https://github.com/catamphetamine/react-phone-number-input/pull/74
Issue Analytics
- State:
- Created 6 years ago
- Comments:38 (21 by maintainers)
Top Results From Across the Web
Screen jumps and skips while typing - Samsung Community
Sometimes when am trying to type in notes,batter 4 lines the previous text gets deleted and the cursor moves to a random place...
Read more >Samsung keyboard not working? Here's how to fix it | Asurion
First, restart your phone · Try restarting the keyboard, too · Clear the keyboard's data · Check for any available software updates ·...
Read more >Galaxy S20/S21: How to Fix Keyboard Badly Misspelled ...
Learn how you can fix the keyboard severely misspelled or the touch screen has sensitivity issue after the latest Android OS update on ......
Read more >How To FIX Android Keyboard Not Working! (2021) - YouTube
GET SUPER CHEAP PHONES HERE: https://cheapphones.coMY MUSIC: https://soundcloud.com/SimpleAlpacaSUB TO MY SECOND CHANNEL!
Read more >How to Use Keyboard Cursor Control to Move Cursor - YouTube
Learn how you can use the keyboard cursor control to move the cursor by sliding the finger across the keyboard on Galaxy S20...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Xopsy wow, thanks for thorough testing 👍 Ok then, it works.
Samsung seems to be a really big company that can afford writing its own everything: their own Android shell, their own Bixby, their own web browser… Looks like another Microsoft to me.
I added a
smartCaret={false}
property which setsinputComponent
to<BasicInput/>
. Use it instead of passinginputComponent={BasicInput}
directly.The demo has also been updated with an example of using the
smartCaret={false}
property.Hey @catamphetamine, I did test right now with new version and still working fine in my samsung phone.
I’ve tested to different browsers from Samsung Galaxy S7 Edge:
Chrome ✅ Firefox ✅ Samsung Internet Browser ❌
Even I have simulated with Xcode iPhone X (Safari Browser ✅) is working fine.
But for main mobile browser (Chrome and Safari) is working fine.
The problem only persist with that Samsung browser but this one is a minor issue, I haven’t tried other browsers. You have more here.
Also I leave a codePen. I did quickly test in there. Everyone can check it for their self.