Bläddra i källkod

Bugfix. Using enter to choose category caused TypeError

JC Brand 8 månader sedan
förälder
incheckning
62cd095169
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      src/shared/chat/emoji-picker.js

+ 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();