Skip to content
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(switch): handle aria-checked correctly. (#5202) #5357

Merged
merged 4 commits into from
Jan 7, 2020

Conversation

Yavanosta
Copy link
Contributor

@Yavanosta Yavanosta commented Dec 18, 2019

Handle aria-checked attribute on MDC Web level, so developers should not implement this logic.

Aria checked is required for role="switch" elements.

In addition after this fix MDC Web catalog website should be updated.

Closes #5202

BREAKING CHANGE: Added setNativeControlAttr method in mdc-switch adapter.

@codecov-io
Copy link

codecov-io commented Dec 18, 2019

Codecov Report

Merging #5357 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5357      +/-   ##
==========================================
+ Coverage   97.63%   97.71%   +0.08%     
==========================================
  Files         163      163              
  Lines        6293     6299       +6     
  Branches      857      857              
==========================================
+ Hits         6144     6155      +11     
+ Misses        149      144       -5
Impacted Files Coverage Δ
packages/mdc-switch/constants.ts 100% <ø> (ø) ⬆️
packages/mdc-switch/component.ts 98.3% <100%> (+6.92%) ⬆️
packages/mdc-switch/foundation.ts 100% <100%> (ø) ⬆️
packages/mdc-auto-init/index.ts 96% <0%> (+4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6808c5...0c0fc2c. Read the comment docs.

packages/mdc-switch/README.md Outdated Show resolved Hide resolved
packages/mdc-switch/foundation.ts Outdated Show resolved Hide resolved
test/unit/mdc-switch/foundation.test.js Outdated Show resolved Hide resolved
test/unit/mdc-switch/foundation.test.js Outdated Show resolved Hide resolved
@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit e91ae6f vs. master! 💯🎉

Copy link
Collaborator

@allan-chen allan-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit e91ae6f vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 186537e vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 98e2827 vs. master! 💯🎉

Copy link
Collaborator

@abhiomkar abhiomkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this change introduces new adapter method this is a breaking changes.

You would need to add BREAKING CHANGE: <description_of_breaking_change> line to PR description and also in commit description for CHANGELOG.

Thanks!

@@ -48,4 +48,9 @@ export interface MDCSwitchAdapter {
* Sets the disabled state of the native HTML control underlying the switch.
*/
setNativeControlDisabled(disabled: boolean): void;

/**
* Set an attribute value of the native HTML control underlying the switch.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you sync-in all the changes from your CL. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I remember that MDC Web is not synced yet, so added commit with typo fix. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to PR description and to commit.

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 2659b45 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 0c0fc2c vs. master! 💯🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mdc-switch] add required aria-checked
6 participants