Skip to content

fix(FormFieldCombobox, FormFieldMultiSelect): point the label at the trigger and pass the invalid state (#574) - #595

Merged
mathewtaylor merged 1 commit into
v4.2.0from
foreman/ravi/ml-124
Oct 5, 2026
Merged

mathewtaylor merged 1 commit into
v4.2.0from
foreman/ravi/ml-124

Conversation

@mathewtaylor

Copy link
Copy Markdown
Contributor

Follow-up to #587 (#574).

BbFormFieldCombobox and BbFormFieldMultiSelect rendered a label with no for, so it wasn't tied to the control, and never passed their invalid state down, so ErrorText didn't set aria-invalid on the trigger.

Changes

  • Both wrappers pass the field's generated id as TriggerId and point BbFieldLabel For at it, matching BbFormFieldTreeSelect.
  • Both pass IsInvalid to the inner control, so ErrorText and form validation errors both mark the trigger invalid.
  • Demo accessibility notes for both pages now say what the label and aria-invalid are tied to.

Tests

  • New FormFieldTriggerTests (8 tests): label for matches the trigger button's id; aria-invalid and aria-describedby follow ErrorText/HelperText; the trigger follows form validation that runs after render, both ways.
  • The label and ErrorText tests fail on the old wrappers. The form-validation tests pass either way; they guard that passing IsInvalid down doesn't stop the trigger following validation.
  • Full suite: 1113 passed. No public API change.

BbFormFieldSelect has the same unlinked label; that's left for a separate change.

…trigger and pass the invalid state (#574)

Both wrappers rendered a BbFieldLabel with no for, so the label wasn't tied to the control, and kept their invalid state to themselves, so ErrorText never reached the trigger's aria-invalid. They now give the inner control's trigger the field's generated id, point the label's for at it, and pass IsInvalid down, the way BbFormFieldTreeSelect does.
@mathewtaylor
mathewtaylor merged commit 2ed6d69 into v4.2.0 Oct 5, 2026
1 check passed
@mathewtaylor
mathewtaylor deleted the foreman/ravi/ml-124 branch October 5, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant