Skip to content

Commit 98c8dec

Browse files
committed
fix(ui): fix collapse-transition not work when el hide initially
1 parent a6c6f2f commit 98c8dec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/ui/src/components/_transition/CollapseTransition.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ export function DCollapseTransition(props: DCollapseTransitionProps): JSX.Elemen
124124
break;
125125

126126
case 'leave':
127+
if (originalSize[isHorizontal ? 'width' : 'height'] === 0) {
128+
originalSize[isHorizontal ? 'width' : 'height'] = ref.current?.[isHorizontal ? 'offsetWidth' : 'offsetHeight'];
129+
}
127130
Object.assign(transitionStyle, originalSize, {
128131
overflow: 'hidden',
129132
});

0 commit comments

Comments
 (0)