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

input element setSelectionRange after backspace does not work in IE10 #7489

Closed
msafi opened this issue Aug 13, 2016 · 3 comments
Closed

input element setSelectionRange after backspace does not work in IE10 #7489

msafi opened this issue Aug 13, 2016 · 3 comments

Comments

@msafi
Copy link

msafi commented Aug 13, 2016

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

  1. Open this demo in IE10
  2. Type any five character text
  3. Caret should be at position 2 (i.e. 12|345) because it is forced there after every change with setSelectionRange
  4. Use arrow or mouse to move caret to position 5 (i.e. 12345|).
  5. Press backspace
  6. Caret goes to position 4 (i.e. 1234|)

What is the expected behavior?

Caret should obey setSelectionRange and go to position 2 even after backspace on IE10.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

This bug started at React v15.0.0. React v14.8 did not have this problem.

This issue was reported here text-mask/text-mask#133. @Heymdall found out that if you wrap setSelectionRange in a setTimeout(..., 0), it sets the position correctly, though the user would have to type slowly to ensure this always happens, so that is not a workaround.

@gaearon
Copy link
Collaborator

gaearon commented Jan 5, 2018

Is this also an issue in React 16?

@mobilerndev
Copy link

pls recheck

@gaearon
Copy link
Collaborator

gaearon commented Mar 29, 2022

We've dropped IE from supported browsers in React 18 so this is unlikely to get fixed.
Sorry.

@gaearon gaearon closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants