question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cursor doesn't keep up with typing on some Samsung Android phones

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Comments:38 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
catamphetaminecommented, Apr 19, 2018

@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 sets inputComponent to <BasicInput/>. Use it instead of passing inputComponent={BasicInput} directly.

The demo has also been updated with an example of using the smartCaret={false} property.

2reactions
Xopsycommented, Apr 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found