Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tasty-drinks-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Fix content visibility in Disclosure.
6 changes: 6 additions & 0 deletions src/components/actions/ItemButton/ItemButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ const ItemButton = forwardRef(function ItemButton(
type = 'neutral',
theme,
onPress,
// Extract react-aria press callbacks to prevent them from leaking to DOM via rest.
// These are handled by useButton inside useAction.
onPressStart: _onPressStart,
onPressEnd: _onPressEnd,
onPressChange: _onPressChange,
onPressUp: _onPressUp,
actions,
size = 'medium',
wrapperStyles,
Expand Down
5 changes: 3 additions & 2 deletions src/components/content/Disclosure/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface CubeDisclosureProps
}

export interface CubeDisclosureTriggerProps
extends Omit<CubeItemButtonProps, 'onPress'> {
extends Omit<CubeItemButtonProps, 'onPress' | 'isDisabled'> {
/** Children content for the trigger */
children?: ReactNode;
}
Expand Down Expand Up @@ -184,13 +184,14 @@ const ContentWrapperElement = tasty({
'': '0',
shown: 'max-content',
},
transition: 'height $disclosure-transition linear',
transition: 'height $disclosure-transition',
},
});

const ContentElement = tasty({
qa: 'DisclosureContent',
styles: {
contentVisibility: 'auto',
padding: '1x',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,8 @@ export function DisplayTransition({
const refCallback: RefCallback<HTMLElement> = (node) => {
if (node) {
elementRef.current = node;

if (phaseRef.current === 'enter') {
ensureEnterFlow();
}
// Don't call ensureEnterFlow() here - useLayoutEffect handles RAF scheduling
// to ensure symmetric timing with exit flow
} else {
cleanupEventListeners();
elementRef.current = null;
Expand Down
Loading