Commit 45ebc70b authored by JC Brand's avatar JC Brand

Let escape close the emoji picker

parent a014eca9
...@@ -169,6 +169,7 @@ export default class EmojiPicker extends CustomElement { ...@@ -169,6 +169,7 @@ export default class EmojiPicker extends CustomElement {
} else if (ev.keyCode === converse.keycodes.ENTER) { } else if (ev.keyCode === converse.keycodes.ENTER) {
this.onEnterPressed(ev); this.onEnterPressed(ev);
} else if (ev.keyCode === converse.keycodes.ESCAPE) { } else if (ev.keyCode === converse.keycodes.ESCAPE) {
u.ancestor(this, 'converse-emoji-dropdown').hideMenu();
this.chatview.el.querySelector('.chat-textarea').focus(); this.chatview.el.querySelector('.chat-textarea').focus();
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();
...@@ -238,10 +239,8 @@ export default class EmojiPicker extends CustomElement { ...@@ -238,10 +239,8 @@ export default class EmojiPicker extends CustomElement {
} }
enableArrowNavigation (ev) { enableArrowNavigation (ev) {
if (ev) { ev?.preventDefault?.();
ev.preventDefault(); ev?.stopPropagation?.();
ev.stopPropagation();
}
this.disableArrowNavigation(); this.disableArrowNavigation();
this.navigator.enable(); this.navigator.enable();
this.navigator.handleKeydown(ev); this.navigator.handleKeydown(ev);
......
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