Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

key up event #540

Open
negatratoron opened this issue Aug 14, 2015 · 3 comments
Open

key up event #540

negatratoron opened this issue Aug 14, 2015 · 3 comments

Comments

@negatratoron
Copy link

Looking at the events here

https://github.com/xing/wysihtml5/wiki/Events

There's a change event, but it doesn't fire each time the user enters a character. There's also a newword:composer event, but there's nothing like a keyup event as far as I can tell.

Anyone else think a keyup event should be added?

@Guam
Copy link

Guam commented Aug 14, 2015

I think this would be a good feature to trigger an auto-complete search.

@Velora
Copy link

Velora commented Sep 13, 2015

I think someone mentioned here awhile back a way this could be accomplished by using editor.composer.doc to attach event listeners. I'm using this solution:

  var editor = new wysihtml5.Editor("editor");

    editor.on("load", function() {
        var $doc = $(editor.composer.doc);
        $doc.keyup(function(){
           // Your code here
        });
    });

@mark222
Copy link

mark222 commented Sep 22, 2015

I would like the "change" event to work as one would expect. Currently it only fires when the editor loses focus... I can set a blur event for that, so this is not helpful. I would expect a change event to fire on anything that causes the state of the editor to change - a character typed, text pasted or cut, a style change, etc. Anything that would cause getValue() to return something different.

Then it becomes simple to write auto-save functions, auto-complete, and anything that requires immediate response to content changes. Key up/down is not sufficient for lots of cases that cause content to change without a physical keystroke.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants