File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
helpers/DisplayTransition Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @cube-dev/ui-kit " : patch
3+ ---
4+
5+ Fix content visibility in Disclosure.
Original file line number Diff line number Diff line change @@ -100,6 +100,12 @@ const ItemButton = forwardRef(function ItemButton(
100100 type = 'neutral' ,
101101 theme,
102102 onPress,
103+ // Extract react-aria press callbacks to prevent them from leaking to DOM via rest.
104+ // These are handled by useButton inside useAction.
105+ onPressStart : _onPressStart ,
106+ onPressEnd : _onPressEnd ,
107+ onPressChange : _onPressChange ,
108+ onPressUp : _onPressUp ,
103109 actions,
104110 size = 'medium' ,
105111 wrapperStyles,
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export interface CubeDisclosureProps
8080}
8181
8282export interface CubeDisclosureTriggerProps
83- extends Omit < CubeItemButtonProps , 'onPress' > {
83+ extends Omit < CubeItemButtonProps , 'onPress' | 'isDisabled' > {
8484 /** Children content for the trigger */
8585 children ?: ReactNode ;
8686}
@@ -184,13 +184,14 @@ const ContentWrapperElement = tasty({
184184 '' : '0' ,
185185 shown : 'max-content' ,
186186 } ,
187- transition : 'height $disclosure-transition linear ' ,
187+ transition : 'height $disclosure-transition' ,
188188 } ,
189189} ) ;
190190
191191const ContentElement = tasty ( {
192192 qa : 'DisclosureContent' ,
193193 styles : {
194+ contentVisibility : 'auto' ,
194195 padding : '1x' ,
195196 } ,
196197} ) ;
Original file line number Diff line number Diff line change @@ -327,10 +327,8 @@ export function DisplayTransition({
327327 const refCallback : RefCallback < HTMLElement > = ( node ) => {
328328 if ( node ) {
329329 elementRef . current = node ;
330-
331- if ( phaseRef . current === 'enter' ) {
332- ensureEnterFlow ( ) ;
333- }
330+ // Don't call ensureEnterFlow() here - useLayoutEffect handles RAF scheduling
331+ // to ensure symmetric timing with exit flow
334332 } else {
335333 cleanupEventListeners ( ) ;
336334 elementRef . current = null ;
You can’t perform that action at this time.
0 commit comments