Commit adee252b authored by JC Brand's avatar JC Brand

Close emoji dropdown on enter and prevent default

parent 23b65f5f
...@@ -61556,6 +61556,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -61556,6 +61556,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
} else if (ev.keyCode === _converse.keycodes.ESCAPE) { } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
return this.onEscapePressed(ev); return this.onEscapePressed(ev);
} else if (ev.keyCode === _converse.keycodes.ENTER) { } else if (ev.keyCode === _converse.keycodes.ENTER) {
_.invoke(this.emoji_dropdown, 'toggle');
return this.onFormSubmitted(ev); return this.onFormSubmitted(ev);
} else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) { } else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) {
return this.editEarlierMessage(); return this.editEarlierMessage();
...@@ -61735,6 +61737,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -61735,6 +61737,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}, },
insertEmoji(ev) { insertEmoji(ev) {
ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target; const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
this.insertIntoTextArea(target.getAttribute('data-emoji')); this.insertIntoTextArea(target.getAttribute('data-emoji'));
...@@ -896,6 +896,7 @@ ...@@ -896,6 +896,7 @@
} else if (ev.keyCode === _converse.keycodes.ESCAPE) { } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
return this.onEscapePressed(ev); return this.onEscapePressed(ev);
} else if (ev.keyCode === _converse.keycodes.ENTER) { } else if (ev.keyCode === _converse.keycodes.ENTER) {
_.invoke(this.emoji_dropdown, 'toggle');
return this.onFormSubmitted(ev); return this.onFormSubmitted(ev);
} else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) { } else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) {
return this.editEarlierMessage(); return this.editEarlierMessage();
...@@ -1047,6 +1048,7 @@ ...@@ -1047,6 +1048,7 @@
}, },
insertEmoji (ev) { insertEmoji (ev) {
ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target; const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
this.insertIntoTextArea(target.getAttribute('data-emoji')); this.insertIntoTextArea(target.getAttribute('data-emoji'));
......
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