-
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!: update checkbox to use slotted input #2539
Conversation
2e76c04
to
576cfae
Compare
b8e1833
to
d82402e
Compare
this.addEventListener('blur', () => { | ||
this._setActive(false); | ||
}); |
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.
note: Having this blur
listener causes the checkbox to lose the active
attribute in case the user switches the checkbox by clicking on the label (for some reason, there is fired the blur event on <vaadin-checkbox>
(!!) while moving focus between the input and the label).
Didn't have enough time to investigate that all the way but I assume the blur
listener can be removed altogether.
It originally came to the mixin from the button component. However, even for the button, it doesn't look relevant since we changed its implementation so that there are not any native buttons.
}); | ||
|
||
it('empty', async () => { | ||
element.label = ''; |
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.
note: The margin between the label and the input is defined separately for the RTL and LTL modes. The margin should disappear when there is no label. That being so, I thought it is reasonable to test the empty label case for both modes.
Some of the visual tests are failing now due to an issue that is not actually caused by this PR:
|
7ede8a7
to
859cce8
Compare
One of the
... and I'm currently searching for a way to fix it. |
9ec9cb9
to
f96ef7a
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.
Thanks @vursen for your attention to detail 💯
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This ticket/PR has been released with platform 22.0.0.alpha7 and is also targeting the upcoming stable 22.0.0 version. |
Description
The PR re-implements
<vaadin-checkbox>
to make it use slotted input. Using slotted input improves the checkbox's accessibility as proven by the prototype.Along the way, the PR introduces the
label
attribute for the checkbox. The attribute can be used as an alternative way to define a label for a checkbox besides using the default slot.<vaadin-checkbox>
to use the slotted input.<vaadin-checkbox>
pass.<vaadin-checkbox-group>
pass.<vaadin-grid-pro>
pass (see the comment).Fixes #2212
Fixes #980
Type of change
Checklist