From f5f1ba1d09be3a4652f96b315e7e82002e8d522e Mon Sep 17 00:00:00 2001 From: Cedric Versluys Date: Tue, 26 Jul 2022 16:47:38 +0200 Subject: [PATCH] feat: Stricter querySelector for toolbar tab changes --- src/module-toolbar-emoji.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/module-toolbar-emoji.js b/src/module-toolbar-emoji.js index 2aa9c75..028b31a 100644 --- a/src/module-toolbar-emoji.js +++ b/src/module-toolbar-emoji.js @@ -113,9 +113,9 @@ function fn_showEmojiPalette(quill) { tabElement.dataset.filter = emojiType.type; tabElementHolder.appendChild(tabElement); - let emojiFilter = document.querySelector('.filter-' + emojiType.name); + let emojiFilter = tabElementHolder.querySelector('.filter-' + emojiType.name); emojiFilter.addEventListener('click', function () { - let tab = document.querySelector('.active'); + let tab = tabElementHolder.querySelector('.active'); if (tab) { tab.classList.remove('active'); } @@ -128,7 +128,7 @@ function fn_showEmojiPalette(quill) { function fn_emojiPanelInit(panel, quill) { fn_emojiElementsToPanel('p', panel, quill); - document.querySelector('.filter-people').classList.add('active'); + document.querySelector('#emoji-palette #tab-toolbar .filter-people').classList.add('active'); } function fn_emojiElementsToPanel(type, panel, quill) {