react-intl-tel-input
react-intl-tel-input copied to clipboard
Fixes #260: Fix cursor position
Coverage increased (+0.02%) to 94.048% when pulling df9c35da4de45e156d7f5081f03360af299c7089 on tomegz:improved-6.1.0 into 6c8ce61a1b0239aaf9fa9bf24320eff59111f108 on patw0929:master.
Can you close this?
I fixed this issue some time back, will have a look & fix it
But I dont see this happening in our live demo app
Look at the code from my example #260 . I'm using number instead of value.
If you want to reproduce it on master just change :
this.setState({
[name]: value,
})
to:
this.setState({
[name]: number,
})
in example.js. Then run npm start and see that example brakes.
can you tell why are you using number?
Why can't you use value?
like in example
I am just trying to understand the use case. like why would you format a number which has not been completely entered
My use case is, that I want to show the user the formatted number including the country code. I think the cursor shouldn't brake regardless of what I want to in the input.
ok got your use case.
But I think we need to improve our logic here.
Just try this with your change
- Completely enter the formatted number
- After that move the cursor to middle, then delete 1 number by clicking backspace
- the cursor will jump to end
@tomegz would you like to help us on this?
This might help https://github.com/patw0929/react-intl-tel-input/blob/master/src/components/IntlTelInputApp.js#L1180
@superhit0 You're right, I didn't take it into account. Yes, I'll see what I can do when I have some time 👍
This might help as well https://github.com/patw0929/react-intl-tel-input/pull/221/files
putting a do not merge for now
@tomegz I have raised another PR, can you can test your use cases on those changes?
https://github.com/patw0929/react-intl-tel-input/pull/262
I still have an issue with the curser when I enter any number starting with +2784... the curser will then move to the front of the cell phone number.