Commit bbf4c08f authored by JC Brand's avatar JC Brand

Prevent emoji from being inserted twice

parent ccbf0490
......@@ -200,8 +200,14 @@ export default class EmojiPicker extends CustomElement {
}
onEnterPressed (ev) {
if (ev.emoji_keypress_handled) {
// Prevent the emoji from being inserted a 2nd time due to this
// method being called by two event handlers: onKeyDown and _onGlobalKeyDown
return;
}
ev.preventDefault();
ev.stopPropagation();
ev.emoji_keypress_handled = true;
if (converse.emojis.shortnames.includes(ev.target.value)) {
this.insertIntoTextArea(ev.target.value);
} else if (this.search_results.length === 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment