jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.32k stars 318 forks source link

Capability to detect change on input #101

Closed stevef closed 1 year ago

stevef commented 6 years ago

Is there an event I can use to detect if the input/textarea has been changed at all, whether directly by the user or via the WYSIWYG editor?

philhawthorne commented 5 years ago

Incase someone comes across this issue, there seems to be an option for this. Set norealTime to false, which will allow you to see events as the user types in them on blur, change and keyup.

window.emojiPicker = new EmojiPicker({
    emojiable_selector: '[data-emojiable=true]',
    assetsPath: '../img/',
    popupButtonClasses: 'fa fa-smile-o',
    norealTime: false
});
linktoahref commented 1 year ago

Via the WYSIWYG editor, you can bind an input event handler to the contenteditable div

document.getElementById("editor").addEventListener("input", function() {
    console.log("input event fired");
}, false);

Reference