Repository navigation
fix(FormFieldSelect): point the label at the trigger and mark it invalid (#574) - #596
Merged
Merged
Conversation
…lid (#574) BbFormFieldSelect already gave its trigger the field's generated id, but its BbFieldLabel had no for, so the label wasn't tied to the trigger, and the trigger never got aria-invalid from ErrorText or form validation. The label now points at the trigger, and the trigger carries aria-invalid="true" while the field is invalid (absent otherwise), matching BbFormFieldCombobox and BbFormFieldMultiSelect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #574, following #595 for FormFieldCombobox and FormFieldMultiSelect.
BbFormFieldSelect already gave its trigger the field's generated id, but:
BbFieldLabelhad noFor, so the label wasn't tied to the trigger;aria-invalid, whether fromErrorTextor form validation.Changes
BbFormFieldSelect:<BbFieldLabel For="@ControlId">, and the trigger getsaria-invalid="true"while the field is invalid. When it's valid the attribute is left off, not set to"false".FormFieldSelectDemo: the Accessibility list now says what the component actually does.FormFieldSelectTriggerTests(4 tests, same pattern asFormFieldTriggerTestsin fix(FormFieldCombobox, FormFieldMultiSelect): point the label at the trigger and pass the invalid state (#574) #595): the label'sformatches the trigger id, andaria-invalid/aria-describedbyfollowErrorText,HelperTextand form validation as it's set and cleared.No public API change.
Testing