Skip to content

Commit

Permalink
fix: transition
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe committed Apr 14, 2024
1 parent bcccaf2 commit ad9cd0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions components/collapse/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
const renderExpandIcon = React.useCallback(
(panelProps: PanelProps = {}) => {
const icon =
typeof mergedExpandIcon === 'function' ? (
mergedExpandIcon(panelProps)
) : (
<RightOutlined rotate={panelProps.isActive ? 90 : undefined} />
);
typeof mergedExpandIcon === 'function' ? mergedExpandIcon(panelProps) : <RightOutlined />;
return cloneElement(icon, () => ({
className: classNames((icon as React.ReactElement)?.props?.className, `${prefixCls}-arrow`),
}));
Expand Down
4 changes: 4 additions & 0 deletions components/collapse/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export const genBaseStyle: GenerateStyle<CollapseToken> = (token) => {
transition: `transform ${motionDurationSlow}`,
},

[`&-active ${componentCls}-arrow`]: {
transform: `rotate(90deg)`,
},

// >>>>> Text
[`${componentCls}-header-text`]: {
marginInlineEnd: 'auto',
Expand Down

0 comments on commit ad9cd0e

Please sign in to comment.