Search code examples
javascriptcoffeescriptckeditordom-eventsfckeditor

keyup event in CKEditor


I'm using CKEditor and have an initEditor function that bootstraps all the event handler function of the editor instance like this:

btw, I'm using CoffeeScript

editor.on 'change', => ...
editor.on 'blur', => ...
editor.on 'key', => ...

and soon I found that the keyevent is actually keydown, I wonder there is a keyup event API, because this doesn't seem to work in my code:

editor.on 'keyup', => ...

and I got an error:

TypeError: editor.onKeyup is not a function

in:

editor.onKeyup((e) => {...})

Solution

  • Editor doesn't have a keyup event. If you want to catch it you should bind it to editors dom.

    editor.document.on('keyup',function(){alert('kek')});