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: Listen text input event(for IE) #36

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

Conversation

st44100
Copy link

@st44100 st44100 commented Jun 4, 2015

ContentEditable in IE fire textinput instead of input.

Add event listener for textinput event.

@st44100 st44100 force-pushed the fix/ie-input-event branch 2 times, most recently from 22132ab to 27d95bb Compare June 4, 2015 09:38
@st44100 st44100 changed the title Fix: Listen textiput event(for IE) Fix: Listen text input event(for IE) Jul 13, 2015
@Be-ngt-oH
Copy link

Unfortunately this is only half the truth. IE is really unique (not in a good way!). This article mentions the following:
Unsurprisingly, IE 9 has some problems of its own.

IE 9 claims to support the input event, but it fails to fire the input event upon deleting text. Worse yet, text deletions don’t trigger propertychange either.

Fortunately, the IE developers were merciful and decided to fire the selectionchange event on every deletion, presumably because the cursor is moving and that counts as the selection changing. If we bind to selectionchange as well as propertychange, keyup, and keydown, we can catch all input events.

The behavior I perceived in IE11 is similar. The textinput helps, but is only fired when inserting and not upon deletion. So I suggest to add 'selectionchange propertychange keyup keydown' as well.

Now the worst part: Even with the whole event of keyboard and text input related events this does not react to copy&pasting. 'mouseup mousedown click paste' didn't help.

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