Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pasting number doesn't select correct country #320

Closed
samthomson opened this issue Apr 29, 2020 · 11 comments
Closed

pasting number doesn't select correct country #320

samthomson opened this issue Apr 29, 2020 · 11 comments

Comments

@samthomson
Copy link

  1. click in to input
  2. press ctrl + A
  3. paste in from clipboard '4522594586'

Expectation: Danish flag is selected, with the number component 22594586
Reality: US flag is shown, and number 122594586

Note: This only happens the first time, second time round it works as expected. Reloading the page brings it back to the initial problematic state.

Seems related to but different from this issue as #201 (not just Danish numbers though, I can reproduce on all numbers).

If this can't be fixed, perhaps a prop to disable autoparsing of country code would help.

Thanks.

@mukeshsoni
Copy link
Owner

@samthomson Can you open a PR for adding a prop for disabling auto parsing of country code?

@samthomson
Copy link
Author

Sure, but in that case I'll look to fix handling the initial pasted value (unless you know that to be a dead end) since that where the bug is.
I just pulled down the project and ran as per instructions at base of read me and got an error:

image

Can you confirm following those instructions work for you (ie clone in to new directory, then npm i && npm run start) or advise on local development?

Thanks.

@mukeshsoni
Copy link
Owner

Have pushed a fix for the build. You can pull the latest master.

@mukeshsoni
Copy link
Owner

@samthomson I am changing the testing library as well as fixing a number of other bugs.

You can checkout the PR here - https://github.com/mukeshsoni/react-telephone-input/pulls

You can use the bugfixes branch which is now stable. It will build properly as well as all the tests pass. I will merge to master soon.

@mukeshsoni
Copy link
Owner

@samthomson I could not reproduce it in 4.75.5. Might have been fixed with other bug fixes i made.

@samthomson
Copy link
Author

Hey, getting to this now,
Just updated to v 5, still an issue sadly. Please re-open the issue and I'll start on a PR.

Unfortunately the local demo/test page doesn't seem to work (no build errors this time, just blank screen rendered):
image
Any ideas?

@samthomson
Copy link
Author

(it does appear the app has built successfully)
image

@mukeshsoni
Copy link
Owner

Oh. Didn't know the demo was broken. Let me take a look.

@mukeshsoni
Copy link
Owner

@samthomson Have fixed the demo server thing. You should see the demos now.

@samthomson
Copy link
Author

Can confirm the issue was in my code base. Sorry for wasting your time. A related component was changing the state of your phone input 😓
Thanks for helping, and good to know you're open to PRs for the future 👍

@mukeshsoni
Copy link
Owner

No problem. Glad you found the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants