Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clayton committed Feb 24, 2025
1 parent 3b58b8e commit 89b7fb3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions libs/blocks/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,13 @@ function getUniqueId(el, rootElem) {
return [...tabs].indexOf(el) + 1;
}

function stopEventBubbling(event) {
event.stopPropagation();
}

function configTabs(config, rootElem) {
if (config['active-tab']) {
const id = `#tab-${CSS.escape(config['tab-id'])}-${CSS.escape(getStringKeyName(config['active-tab']))}`;
const sel = rootElem.querySelector(id);
if (sel) {
sel.addEventListener('click', stopEventBubbling, false);
sel.addEventListener('click', (e) => e.stopPropagation(), { once: true });
sel.click();
sel.removeEventListener('click', stopEventBubbling, false);
}
}
const tabParam = new URLSearchParams(window.location.search).get('tab');
Expand Down

0 comments on commit 89b7fb3

Please sign in to comment.