Skip to content

Commit

Permalink
refactor(sanity): spread rest props on CollapseMenu to enable addin…
Browse files Browse the repository at this point in the history
…g test id
  • Loading branch information
hermanwikner authored and rexxars committed Sep 23, 2022
1 parent 1283603 commit 451ce02
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/sanity/src/components/collapseMenu/CollapseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const CollapseMenu = forwardRef(function CollapseMenu(
gap,
menuButtonProps,
onMenuClose,
...rest
} = props
const [rootEl, setRootEl] = useState<HTMLDivElement | null>(null)
const [hiddenRowEl, setHiddenRowEl] = useState<HTMLDivElement | null>(null)
Expand Down Expand Up @@ -169,7 +170,14 @@ export const CollapseMenu = forwardRef(function CollapseMenu(
}

return (
<OuterFlex align="center" data-ui="CollapseMenu" overflow="hidden" sizing="border" ref={ref}>
<OuterFlex
align="center"
data-ui="CollapseMenu"
overflow="hidden"
sizing="border"
ref={ref}
{...rest}
>
<RootFlex direction="column" flex={1} justify="center" ref={setRootEl}>
{/* Content */}
<RowFlex gap={gap}>
Expand Down

0 comments on commit 451ce02

Please sign in to comment.