-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(checkbox): added aria-checked=mixed to indeterminate state #2389
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2389 +/- ##
==========================================
+ Coverage 98.85% 98.86% +<.01%
==========================================
Files 100 100
Lines 4118 4123 +5
Branches 527 528 +1
==========================================
+ Hits 4071 4076 +5
Misses 47 47
Continue to review full report at Codecov.
|
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.
Got a question about potential race conditions
packages/mdc-checkbox/foundation.js
Outdated
@@ -203,6 +211,10 @@ class MDCCheckboxFoundation extends MDCFoundation { | |||
return; | |||
} | |||
|
|||
// Remove aria-checked (needed for initial inditerminate state) - screen | |||
// readers will pick the right state from input. | |||
this.adapter_.removeNativeControlAttr(strings.ARIA_CHECKED_ATTR); |
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.
Is this a possible race condition between when the property change callback gets called and when the attribute gets added?
If so, the attr settter could be moved inside this (transitionCheckState_
) method with a check made to newState
to determine whether to add or remove.
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.
Make sure to add the breaking change notes to the footer of the commit message: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#footer
LGTM!
BREAKING CHANGE: Adds setNativeControlAttr and removeNativeControlAttr adapter APIs.
No description provided.