-
Notifications
You must be signed in to change notification settings - Fork 83
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
refactor: move ARIA attributes logic to FieldAriaController #3048
Conversation
4e00181
to
1fc408a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General approach looks good, added a couple of non-critical suggestions.
@@ -448,7 +448,7 @@ describe('vaadin-checkbox-group', () => { | |||
let error, helper, label; | |||
|
|||
beforeEach(() => { | |||
group = fixtureSync('<vaadin-checkbox-group helper-text="Choose one"></vaadin-checkbox-group>'); | |||
group = fixtureSync('<vaadin-checkbox-group helper-text="Choose one" label="Label"></vaadin-checkbox-group>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the field groups used to add the label id to the aria-labelledby
attribute even when no label is provided.
The PR aligns it with non-group fields in a way that the label id is now only added to the attribute when a label is present.
82df8ae
to
b830a5f
Compare
47eb482
to
1527867
Compare
4d08be4
to
1361f0f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think we can cherry-pick both #3069 and this to 22.0
branch.
Description
At the moment,
FieldMixin
overrides thearia-labelledby
attribute's initial value with slotted elements' ids (error id, label id...). It turned out to be an obstacle to fixing #1145, where the form-item needs to link its label with a child field via thearia-labelledby
field's attribute, but the attribute ends up overridden byFieldMixin
.AriaLabelController
andFieldMixin
toFieldAriaController
.AriaLabelController
toLabelledInputController
since it doesn't have ARIA attributes related logic anymore.aria-labelledby
attribute's initial value inFieldAriaController
.FieldMixin
.FieldAriaController
.FieldAriaController
.Part of #1145
Type of change
Checklist