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: Fix FieldSet float issue #1268

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions packages/css/src/components/field-set/field-set.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
float: inline-start; // [1]
inline-size: 100%; // [1]
padding-inline: 0;

+ * {
clear: both; // This resets the applied float for the legends first sibling
alimpens marked this conversation as resolved.
Show resolved Hide resolved
}
}

// [1] This combination allows the fieldset border to go around the legend, instead of through it.
Expand Down
6 changes: 3 additions & 3 deletions storybook/src/components/FieldSet/FieldSet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {
render: (args) => (
<FieldSet invalid={args.invalid} legend={args.legend}>
<Column gap="extra-small" style={{ width: '100%' }}>
<Column gap="extra-small">
<Label htmlFor="input1">Voornaam</Label>
<TextInput id="input1" invalid={args.invalid} aria-required="true" />
<Label htmlFor="input2">Achternaam</Label>
Expand Down Expand Up @@ -161,7 +161,7 @@ export const CheckboxGroup: Story = {
},
render: (args) => (
<FieldSet legend={args.legend} invalid={args.invalid}>
<Column gap="extra-small" style={{ width: '100%' }}>
<Column gap="extra-small">
<Checkbox name="about" value="horeca" invalid={args.invalid} aria-required="true">
Horecabedrijf
</Checkbox>
Expand All @@ -187,7 +187,7 @@ export const CheckboxGroup: Story = {
// render: (args) => (
// <FieldSet legend={args.legend} invalid={args.invalid}>
// {args.invalid && <ErrorMessage className="ams-mb--sm">Geef aan waar uw melding over gaat.</ErrorMessage>}
// <Column gap="extra-small" style={{ width: '100%' }}>
// <Column gap="extra-small">
// <Checkbox name="about" value="horeca" invalid={args.invalid} aria-required="true">
// Horecabedrijf
// </Checkbox>
Expand Down
Loading