Skip to content

Commit 3e0159a

Browse files
author
Geoffroy Baccarini
committed
less painfull fix
1 parent 61e9444 commit 3e0159a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

packages/design-system/src/components/Form/Fieldset/Fieldset.module.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
.fieldset {
44
padding: 0;
55
border: none;
6-
display: contents;
76
}
87

98
.legend {
@@ -12,3 +11,9 @@
1211
font: tokens.$coral-heading-m;
1312
margin: 0;
1413
}
14+
15+
.fieldset-content {
16+
display: flex;
17+
flex-flow: column;
18+
gap: tokens.$coral-spacing-s;
19+
}

packages/design-system/src/components/Form/Fieldset/Fieldset.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Children, cloneElement, forwardRef } from 'react';
2-
import type { Ref, FieldsetHTMLAttributes } from 'react';
2+
import type { FieldsetHTMLAttributes, Ref } from 'react';
33
import { isElement } from 'react-is';
44

55
import styles from './Fieldset.module.scss';
@@ -28,9 +28,11 @@ const Fieldset = forwardRef(
2828
{required && '*'}
2929
</legend>
3030
)}
31-
{Children.toArray(children).map(child =>
32-
isElement(child) ? cloneElement(child, childrenProps) : child,
33-
)}
31+
<div className={styles['fieldset-content']}>
32+
{Children.toArray(children).map(child =>
33+
isElement(child) ? cloneElement(child, childrenProps) : child,
34+
)}
35+
</div>
3436
</fieldset>
3537
);
3638
},

0 commit comments

Comments
 (0)