Skip to content

Commit

Permalink
MWPW-165428 Fix georouting tab scroll (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganthecoder authored Feb 3, 2025
1 parent db010d8 commit 6d7af52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions libs/blocks/tabs/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -554,4 +554,9 @@
.tabs.stacked-mobile.quiet div[role="tablist"] button {
margin-inline-start: 0;
}

.tabs[class*='stacked-mobile'] .paddle {
background: unset;
border: none;
}
}
5 changes: 3 additions & 2 deletions libs/blocks/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function changeTabs(e) {
const parent = target.parentNode;
const content = parent.parentNode.parentNode.lastElementChild;
const targetContent = content.querySelector(`#${target.getAttribute('aria-controls')}`);
const blockId = target.closest('.tabs').id;
const tabsBlock = target.closest('.tabs');
const blockId = tabsBlock.id;
parent
.querySelectorAll(`[aria-selected="true"][data-block-id="${blockId}"]`)
.forEach((t) => t.setAttribute('aria-selected', false));
Expand All @@ -77,7 +78,7 @@ function changeTabs(e) {
.querySelectorAll(`[role="tabpanel"][data-block-id="${blockId}"]`)
.forEach((p) => p.setAttribute('hidden', true));
targetContent.removeAttribute('hidden');
scrollStackedMobile(targetContent);
if (tabsBlock.classList.contains('stacked-mobile')) scrollStackedMobile(targetContent);
}

function getStringKeyName(str) {
Expand Down

0 comments on commit 6d7af52

Please sign in to comment.