WYSIHTML5 should trigger events against on original textarea #217

micksear opened this Issue Feb 25, 2013 · 4 comments


None yet

3 participants


I had thought that WYSIHTML5 kept the underlying textarea in sync, but that doesn't seem to be the case. I've got a JSFiddle on the go that will demonstrate this:


I'd have thought that it should be desirable to forward the event to the textarea underneath it all, so in your event, you simply trigger 'change' or 'blur' on the underlying control. That way, you can use normal event handling like:

$('textarea').on('change', function(){...});


I totally agree with this. I am trying to implement a character counter for this control and it seems to be impossible to get hold of the actual element being typed into. Any advice?


Although I think it would be nicer if you can just hook into events on the original textarea directly, you can make it work in that way by doing this:

"events": {
"blur": function() {



Wouldnt that only count the characters after the user leaves the text area? I am looking for some way to listen to the keyup and keydown events so that I can have a dynamic character count similar to twitter's counter.


Use can use editor.composer.doc to attach listeners. See this jsfiddle: http://jsfiddle.net/6dgYp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment