Skip to content

Commit 2e58e0f

Browse files
authored
Merge pull request #943 from dcastil/fix-safari-closing-sidebar-on-accordion-button-click
Fix Safari closing sidebar on accordion button click
2 parents 792c8d2 + ceee453 commit 2e58e0f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/sidenav/src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export const AccordionButton: FunctionComponent<{
152152
title="Expand Section"
153153
disabled={disabled}
154154
{...props}
155+
onMouseDown={(e) => e.preventDefault()}
155156
sx={{
156157
appearance: 'none',
157158
display: 'flex',

packages/sidenav/test/__snapshots__/index.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ exports[`AccordionNav renders open 1`] = `
242242
disabled={false}
243243
href="/bop"
244244
onClick={[Function]}
245+
onMouseDown={[Function]}
245246
pathname=""
246247
title="Expand Section"
247248
>
@@ -404,6 +405,7 @@ exports[`AccordionNav renders with nested links 1`] = `
404405
disabled={false}
405406
href="/bop"
406407
onClick={[Function]}
408+
onMouseDown={[Function]}
407409
pathname=""
408410
title="Expand Section"
409411
>

0 commit comments

Comments
 (0)