From 793cae9871a1377f5e02c54b6f18e45cfa044fe7 Mon Sep 17 00:00:00 2001 From: Jehu Date: Wed, 11 May 2022 11:18:11 +0800 Subject: [PATCH] fix(next/antd): fix form-collapse pass defaultActiveKey (#3107) --- packages/antd/src/form-collapse/index.tsx | 4 +++- packages/next/src/form-collapse/index.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/antd/src/form-collapse/index.tsx b/packages/antd/src/form-collapse/index.tsx index d68207c6667..005d85971c9 100644 --- a/packages/antd/src/form-collapse/index.tsx +++ b/packages/antd/src/form-collapse/index.tsx @@ -103,7 +103,9 @@ export const FormCollapse: ComposedFormCollapse = observer( const panels = usePanels() const prefixCls = usePrefixCls('formily-collapse', props) const _formCollapse = useMemo(() => { - return formCollapse ? formCollapse : createFormCollapse() + return formCollapse + ? formCollapse + : createFormCollapse(props.defaultActiveKey) }, []) const takeActiveKeys = () => { diff --git a/packages/next/src/form-collapse/index.tsx b/packages/next/src/form-collapse/index.tsx index b76c7e7d8ae..9be67657324 100644 --- a/packages/next/src/form-collapse/index.tsx +++ b/packages/next/src/form-collapse/index.tsx @@ -110,7 +110,9 @@ export const FormCollapse: ComposedFormCollapse = observer( const panels = usePanels() const prefixCls = usePrefixCls('formily-collapse', props) const _formCollapse = useMemo(() => { - return formCollapse ? formCollapse : createFormCollapse() + return formCollapse + ? formCollapse + : createFormCollapse(props.defaultExpandedKeys) }, []) const takeExpandedKeys = () => {