Skip to content

Commit 373f18f

Browse files
authored
Prevent section group popovers from opening on click (#3213)
1 parent 3f29206 commit 373f18f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/thirty-donkeys-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Prevent section group popovers from opening on click

packages/gitbook/src/components/SiteSections/SiteSectionTabs.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ export function SiteSectionTabs(props: { sections: ClientSiteSections }) {
8383
)
8484
}
8585
asChild
86+
onClick={(e) => {
87+
if (value) {
88+
e.preventDefault();
89+
e.stopPropagation();
90+
}
91+
}}
8692
>
8793
<SectionGroupTab
8894
isActive={isActive}
@@ -180,7 +186,7 @@ const SectionGroupTab = React.forwardRef(function SectionGroupTab(
180186
ref={ref}
181187
{...rest}
182188
className={tcls(
183-
'group relative my-2 flex select-none items-center justify-between rounded straight-corners:rounded-none px-3 py-1 transition-colors',
189+
'group relative my-2 flex select-none items-center justify-between rounded straight-corners:rounded-none px-3 py-1 transition-colors hover:cursor-default',
184190
isActive
185191
? 'text-primary-subtle'
186192
: 'text-tint hover:bg-tint-hover hover:text-tint-strong'

0 commit comments

Comments
 (0)