Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(collapse): custom prefix in animation #7074

Merged
merged 1 commit into from
Nov 11, 2023
Merged
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
6 changes: 3 additions & 3 deletions components/collapse/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default defineComponent({
accordion: false,
destroyInactivePanel: false,
bordered: true,
openAnimation: collapseMotion('ant-motion-collapse', false),
expandIconPosition: 'start',
}),
slots: Object as CustomSlotsType<{
Expand All @@ -61,7 +60,7 @@ export default defineComponent({
},
{ deep: true },
);
const { prefixCls, direction } = useConfigInject('collapse', props);
const { prefixCls, direction, rootPrefixCls } = useConfigInject('collapse', props);

// style
const [wrapSSR, hashId] = useStyle(prefixCls);
Expand Down Expand Up @@ -131,6 +130,7 @@ export default defineComponent({
if (isEmptyElement(child)) return;
const activeKey = stateActiveKey.value;
const { accordion, destroyInactivePanel, collapsible, openAnimation } = props;
const animation = openAnimation || collapseMotion(`${rootPrefixCls.value}-motion-collapse`);

// If there is no key provide, use the panel order as default key
const key = String(child.key ?? index);
Expand Down Expand Up @@ -161,7 +161,7 @@ export default defineComponent({
isActive,
prefixCls: prefixCls.value,
destroyInactivePanel,
openAnimation,
openAnimation: animation,
accordion,
onItemClick: mergeCollapsible === 'disabled' ? null : onClickItem,
expandIcon: renderExpandIcon,
Expand Down