jmadler / emoji-picker

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

Using emoji-picker disable existing onkeypress #128

Closed basilaiman closed 2 years ago

basilaiman commented 5 years ago

I have this function function onMsgBoxKeyPress(e) { console.log(e); if (e.which == 13) { onSendClick(); return false; } return true; } And this div <textarea data-emojiable="true" id="msgBox" class="form-control" onkeypress="return onMsgBoxKeyPress(event);" placeholder="Type Your Message"></textarea>

Adding data-emojiable disabled the onkeypress event. and the console.log(e); line doesn't log anything

hugocvx commented 4 years ago

Add this to EmojiArea_WYSIWYG function :

if ($($textarea).attr('onkeydown')) { this.$editor.attr('onkeydown', $textarea.attr('onkeydown')); } if ($($textarea).attr('onkeypress')) { this.$editor.attr('onkeypress', $textarea.attr('onkeypress')); }