Skip to content

Commit

Permalink
fix(ui): fix collapse-transition not work when el hide initially
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed Mar 2, 2023
1 parent a6c6f2f commit 98c8dec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ui/src/components/_transition/CollapseTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export function DCollapseTransition(props: DCollapseTransitionProps): JSX.Elemen
break;

case 'leave':
if (originalSize[isHorizontal ? 'width' : 'height'] === 0) {
originalSize[isHorizontal ? 'width' : 'height'] = ref.current?.[isHorizontal ? 'offsetWidth' : 'offsetHeight'];
}
Object.assign(transitionStyle, originalSize, {
overflow: 'hidden',
});
Expand Down

0 comments on commit 98c8dec

Please sign in to comment.