Skip to content

Commit

Permalink
fix(form): do not remove collapsed dom
Browse files Browse the repository at this point in the history
close #5885
  • Loading branch information
chenshuai2144 committed Dec 26, 2022
1 parent 1bb49d6 commit 769177f
Show file tree
Hide file tree
Showing 7 changed files with 11,420 additions and 11,258 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ const Demo = () => {
}}
onFinish={async (value) => console.log(value)}
>
<ProFormGroup label="文本类">
<ProFormGroup title="文本类">
<ProFormText width="md" name="name" label="name" />
<ProFormText.Password width="md" name="password" label="password" />
</ProFormGroup>
<ProFormGroup
label="选择类"
title="选择类"
collapsible
style={{
gap: '0 32px',
}}
Expand Down
8 changes: 7 additions & 1 deletion packages/form/src/components/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ const Group: React.FC<GroupProps> = React.forwardRef((props, ref: any) => {
)}
</div>
)}
{collapsible && collapsed ? null : childrenDoms}
<div
style={{
display: collapsible && collapsed ? 'none' : undefined,
}}
>
{childrenDoms}
</div>
</div>
</ColWrapper>,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/demos/base.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProFormCheckbox, ProFormInstance } from '@ant-design/pro-components';
import { ProFormInstance } from '@ant-design/pro-components';
import {
ProForm,
ProFormCascader,
Expand Down
Loading

0 comments on commit 769177f

Please sign in to comment.