Giter Site home page Giter Site logo

Comments (13)

theseanz avatar theseanz commented on July 26, 2024

I'm having this exact problem with version 1.0.1 on a Nexus 5X and our QA's Samsung S6. I updated to 1.0.2 and it seems to have fixed it on my Nexus 5X, but version 1.2.0 does not work.

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

I've investigated this a bit, and it seems like let cursorPos = el.selectionStart; in the onChangeHandler returns the wrong thing. So after I write for example 4 in the input, cursorPos is still set to 0.

This works however on 1.0.2, where refs where being used.

It happens on my device Google Pixel 7.1.2

Thoughts @s-yadav ?

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

@pudgereyem Hey could not reproduce this on browserstack can you try the alpha version again ?

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

Hi @s-yadaw, I just tried on the Codepen demo and still same error. I can have a look at the changes today.

I get that it's frustrating to not be able to test the version I've reported as not working. Would be nice if we could find a solution. I'll have a look soon.

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

Browserstack does have real device testing but can't reproduce it there either.
Have you installed some custom keyboard on your device?
Also try the codepen again by clearing cache just to make sure old code not been cached.

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

@s-yadav

Yes, it works in Browserstack for me too. But not on my actual phone. I wonder if it's the same version (7.1.2). Browserstack only say (7.1). I've also cleared the cache, didn't help.

Recording

I pulled down the project, using 2.0.0-alpha2, and recorded both my phone, and the Chrome Console (Remote testing).

I also added two lines of code that's logging cursorPosition in onChangeHandler. See screenshot; http://pudge.se/gEraYU

Takeaways

  1. On first input, the cursorPos is wrong. It returns 0 when it should be 1
  2. On first input, the character inputed gets underlined, see screenshot; http://pudge.se/81EVaA
  3. On first input, the keyboard layout is changed, why? see screenshot; http://pudge.se/81EVaA

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

Based on the takeaways in my comment above, I did some testing.
When changing the type to tel it works. I'm not sure why, I'll investigate this more.

ping @s-yadav

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

I guess it has do with your soft keyboard you are using.
Are you using any other keyboard app than native one ?

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

@s-yadav I use the native keyboard. What do you mean with "soft keyboard"?

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

The mobile keyboard. Can you try logging el.selectionStart and el.selectionEnd on onChange handler.

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

@pudgereyem Can you try alpha3 build once? I hope that's the possible fix for pixel.

from react-number-format.

s-yadav avatar s-yadav commented on July 26, 2024

Fixed in 2.0.0 alpha

from react-number-format.

pudgereyem avatar pudgereyem commented on July 26, 2024

Hi @s-yadav, this issue went away if you used type="tel".

from react-number-format.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.