Register the document events once the picker is connected

This commit is contained in:
ubermanu 2021-06-25 14:50:48 +02:00 committed by JC Brand
parent 7503de27c5
commit 524e14f464

View File

@ -38,7 +38,6 @@ export default class EmojiPicker extends CustomElement {
super();
this._search_results = [];
this.debouncedFilter = debounce(input => this.model.set({'query': input.value}), 250);
this.registerEvents();
}
get search_results () {
@ -124,7 +123,7 @@ export default class EmojiPicker extends CustomElement {
disconnectedCallback() {
const body = document.querySelector('body');
body.removeEventListener('keydown', this.onGlobalKeyDown);
super.disconnectedCallback()
super.disconnectedCallback();
}
_onGlobalKeyDown (ev) {