Skip to content
Snippets Groups Projects
Commit 4d8e7e84 authored by Emmanuel Vodor's avatar Emmanuel Vodor
Browse files

bugfix: Fix an error when hiding the emoji dropdown

parent d68c15ad
No related branches found
No related tags found
1 merge request!138WIP: Reactions, emoji picker, etc...
...@@ -48,12 +48,14 @@ converse.plugins.add('sib-emoji-picker', { ...@@ -48,12 +48,14 @@ converse.plugins.add('sib-emoji-picker', {
// Remove any existing pickers // Remove any existing pickers
// Happens when the room is switched with the dropdown opened // Happens when the room is switched with the dropdown opened
// TODO: Add a listener on model change (hidden prop) to automatically hide the menu // TODO: Add a listener on model change (hidden prop) to automatically hide the menu
picker && picker.remove(); if (picker) {
picker.remove();
}
picker = new Picker(); picker = new Picker();
picker.classList.add('light'); picker.classList.add('light');
picker.addEventListener('emoji-click', ev => this.insertIntoTextArea(ev.detail.unicode)); picker.addEventListener('emoji-click', ev => this.insertIntoTextArea(ev.detail.unicode));
this.querySelector('.dropdown-menu').appendChild(picker); this.menu.appendChild(picker);
await _showMenu.apply(this, arguments); await _showMenu.apply(this, arguments);
...@@ -69,7 +71,9 @@ converse.plugins.add('sib-emoji-picker', { ...@@ -69,7 +71,9 @@ converse.plugins.add('sib-emoji-picker', {
*/ */
hideMenu() { hideMenu() {
_hideMenu.apply(this, arguments); _hideMenu.apply(this, arguments);
picker.remove(); if (picker) {
picker.remove();
}
}, },
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment