Skip to content

Commit 7036990

Browse files
committed
fix(components/molecule/accordion): allow overflow visible when expanded to prevent popover clipping
1 parent b7021f9 commit 7036990

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

components/molecule/accordion/src/AccordionItemPanel.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ const AccordionItemPanel = forwardRef(
7272
// grid-template-rows:0fr can collapse it to zero height. These cannot live
7373
// inside the !isFragment spread because isFragment is a function (always truthy),
7474
// making !isFragment always false — the spread never executes.
75-
style={{overflow: 'hidden', minHeight: 0}}
75+
style={{
76+
// overflow must be 'hidden' while collapsed so 0fr clips the content.
77+
// Once expanded, switch to 'visible' so popovers/dropdowns inside the
78+
// panel can overflow outside its bounds (e.g. make/model picker on desktop).
79+
overflow: values.includes(value) ? 'visible' : 'hidden',
80+
minHeight: 0
81+
}}
7682
{...{
7783
...(!isFragment && {
7884
className: `${BASE_CLASS_ITEM_PANEL_CONTENT}Wrapper`
@@ -83,8 +89,7 @@ const AccordionItemPanel = forwardRef(
8389
className={`${BASE_CLASS_ITEM_PANEL_CONTENT}WrapperRef`}
8490
ref={contentRef}
8591
style={{
86-
// min-height: 0 is required for grid-template-rows: 0fr to collapse the child to zero
87-
overflow: 'hidden',
92+
overflow: values.includes(value) ? 'visible' : 'hidden',
8893
minHeight: 0,
8994
// maxHeight prop caps panel height and enables scroll — applied here (not on
9095
// the outer grid wrapper) so it constrains content without affecting the animation

0 commit comments

Comments
 (0)