Skip to content

[fieldset][field] Investigate Fieldsets as validation boundaries #3930

@atomiks

Description

@atomiks

Feature request

Summary

Mentioned here #3807 (comment)

<Field.Root> is currently responsible for creating a validation boundary.

However, it might be more conceptually intuitive to ensure <Field.Root> only labels one single focusable control, instead of a groups of (identical) controls.

That is:

<Fieldset.Root> {/* validation boundary for a radio group */}
  <Fieldset.Legend />

  <Field.Root /> {/* each radio goes in here /*}
  <Field.Root />
  <Field.Root />
</Fieldset.Root>

Where Fieldset.Root can be a validation boundary.

The main issue here seems to be that validation boundaries aren't valid for groups of controls that aren't identical (like a Checkbox Group or especially a Radio Group).

Currently for Checkbox Group and Radio Group, the validation boundary needs to be created by <Field.Root> and labels need to be placed inside <Field.Item>:

<Field.Root> {/* validation boundary for a radio group */}
  <Fieldset.Root>
    <Fieldset.Legend />

    <Field.Item /> {/* each radio goes in here for labeling /*}
    <Field.Item />
    <Field.Item />
  </Fieldset.Root>
</Field.Root>

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: fieldChanges related to the field component.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions