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

Fix bug with selecting and moving cursor within text input: don't setInputData unless value changed. #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liliakai
Copy link

When using a text input rather than textarea, updating the value moves
the cursor to the end of the line. Since core triggers setInputData on
every keystroke, this makes it impossible to highlight, copy, paste, or
move the cursor within the text.

Fix by only updating the value if it has changed.

I believe this also fixes the following known issue:
http://github.com/alexgorbatchev/jquery-textext/issues/50

When using a text input rather than textarea, updating the value moves
the cursor to the end of the line. Since core triggers setInputData on
every keystroke, this makes it impossible to highlight, copy, paste, or
move the cursor within the text.

Fix by only updating the value if it has changed.

I believe this also fixes the following known issue:
http://github.com/alexgorbatchev/jquery-textext/issues/50
@kenglxn
Copy link

kenglxn commented Sep 2, 2014

+1

@liliakai
Copy link
Author

liliakai commented Sep 2, 2014

you open the PR
bats fly out
💀

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

Successfully merging this pull request may close these issues.

2 participants