@@ -52,27 +52,53 @@ const AccordionItemPanel = forwardRef(
5252 className = { accordionItemPanelClassName }
5353 aria-disabled = { disabled }
5454 style = { {
55- overflowY : height > maxHeight && maxHeight !== 0 ? 'scroll' : 'hidden' ,
56- transition : `max-height ${ animationDuration } ms ${
55+ // grid-template-rows animation is layout-safe: siblings are pushed down
56+ // correctly in all browsers including iOS Safari ≥16.4.
57+ // max-height animation was replaced because it requires transform/will-change
58+ // hacks to avoid Safari repaint corruption, and those hacks break document flow.
59+ display : 'grid' ,
60+ gridTemplateRows : values . includes ( value ) ? '1fr' : '0fr' ,
61+ transition : `grid-template-rows ${ animationDuration } ms ${
5762 values . includes ( value ) ? 'ease-out' : 'ease-in'
5863 } , opacity 0s linear ${ values . includes ( value ) ? 0 : animationDuration } ms, border-top-width 0s linear ${
5964 values . includes ( value ) ? 0 : animationDuration
60- } ms`,
61- ...( values . includes ( value ) && {
62- maxHeight : maxHeight === 0 ? height : maxHeight
63- } )
65+ } ms`
6466 } }
6567 { ...props }
6668 >
6769 < Poly
6870 as = { as }
71+ // overflow:hidden + min-height:0 must be on the direct grid child so that
72+ // grid-template-rows:0fr can collapse it to zero height. These cannot live
73+ // inside the !isFragment spread because isFragment is a function (always truthy),
74+ // making !isFragment always false — the spread never executes.
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+ } }
6982 { ...{
7083 ...( ! isFragment && {
7184 className : `${ BASE_CLASS_ITEM_PANEL_CONTENT } Wrapper`
7285 } )
7386 } }
7487 >
75- < div className = { `${ BASE_CLASS_ITEM_PANEL_CONTENT } WrapperRef` } ref = { contentRef } >
88+ < div
89+ className = { `${ BASE_CLASS_ITEM_PANEL_CONTENT } WrapperRef` }
90+ ref = { contentRef }
91+ style = { {
92+ overflow : values . includes ( value ) ? 'visible' : 'hidden' ,
93+ minHeight : 0 ,
94+ // maxHeight prop caps panel height and enables scroll — applied here (not on
95+ // the outer grid wrapper) so it constrains content without affecting the animation
96+ ...( maxHeight !== 0 && {
97+ maxHeight,
98+ overflowY : height > maxHeight ? 'scroll' : 'hidden'
99+ } )
100+ } }
101+ >
76102 { inject ( children , [
77103 {
78104 props : {
0 commit comments