Skip to content

Commit

Permalink
fix(next/antd): fix form-collapse pass defaultActiveKey (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwyx778 authored May 11, 2022
1 parent 19948fd commit 793cae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/antd/src/form-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/next/src/form-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 793cae9

Please sign in to comment.