2
0
Эх сурвалжийг харах

Bugfix. Using enter to choose category caused TypeError

JC Brand 8 сар өмнө
parent
commit
62cd095169

+ 2 - 2
src/shared/chat/emoji-picker.js

@@ -205,8 +205,8 @@ export default class EmojiPicker extends CustomElement {
     chooseCategory (ev) {
         ev.preventDefault && ev.preventDefault();
         ev.stopPropagation && ev.stopPropagation();
-        const target = /** @type {Element} */(ev.target);
-        const el = target.matches('li') ? ev.target : u.ancestor(target, 'li');
+        const target = /** @type {Element} */(ev.target ?? ev.relatedTarget);
+        const el = target.matches('li') ? target : u.ancestor(target, 'li');
         this.setCategoryForElement(el);
         this.navigator.select(el);
         !this.navigator.enabled && this.navigator.enable();