How can I detect the emoji insert event from OS X character viewer and iOS emoji keyboard in Javascript / Redactor?

I'm having trouble getting the Redactor (a WYSIWYG content-accessible web editor from Imperavi) to recognize the character insertion event that comes from the OS Viewer of the character and built-in emoji palettes, as well as the iOS emoji palette.

Redactor doesn't sync changes until I add, say, a space or fire an insert event. It is then picked up and stored as you would expect. Forcing sync before submitting the form is not displaying the character (or I am doing it wrong).

Is there a specific event related to the insert fired by these OS X / iOS palettes, or do you have some workarounds for getting Redactor to notice the symbol?

Try using http://imperavi.com/redactor/examples/placeholder/ ; click inside the text input area, bring up the emoji palette using - ctrl- space, and press emoji to insert it. The placeholder does not disappear, it is one indicator that the insert has not registered.

+3


source to share


1 answer


The DOMCharacterDataModified event marks the insert and can be used to trigger a .redactor ('code.sync').



So, I set up this as an event listener in initCallback and used it when the underlying textbox used by Redactor appears to be empty; this is because even after syncing, content that is solely emoji does not necessarily sync in the future. (When there is content in the textarea, the sync appears to include emoji).

0


source







All Articles