angular-medium-editor
angular-medium-editor copied to clipboard
Fix: Listen text input event(for IE)
ContentEditable in IE fire textinput instead of input.
Add event listener for textinput event.
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.