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
Fire an event on caret position change #111
Comments
This feature request is unlikely to go forward as it doesn't appear to be broadly useful, and there is active pushback to adding any new events. Since I have not heard of any other requests for this, my recommendation would be to use the workaround suggested on the stackoverflow page you link to. Having said that, since this seems editing (contenteditable) related, you might want to see if there is any interest from other developers of text editors. |
Well, even though it is almost two years since SebastianZ requested this event, I, too, could really use such an event. Since it appears that there are only two users in the world interested in this, it is off to the workaround I go. ;) |
@dziesig wrote:
Which workaround is that? Sebastian |
Why not listen for |
Looks like the Sebastian |
For a syntax highlighter I'd like to get the current caret position while pressing keys on the keyboard.
I tried to use the
keydown
event and the legacykeypress
event, but they are fired continuously before the caret position changes. And thekeyup
event is only fired once after the key is released. Besides that there is also theinput
event, though that's just fired on text input and not when the text cursor changes.So, what is missing is an event that is either
input
but even when no input happens likekeydown
, orI slightly prefer the second solution, because it allows to get the caret position even on other input types like mouse events.
Sebastian
The text was updated successfully, but these errors were encountered: