10up / component-library

A library of barebones front-end components built with WordPress and accessibility in mind.
https://baseline.10up.com/
MIT License
59 stars 12 forks source link

aria-expanded values updated based on the callbacks #107

Closed ajmaurya99 closed 1 year ago

ajmaurya99 commented 2 years ago

Description of the Change

The Aria Expanded value is not getting updated via openSubmenu and closeSubmenu callbacks, So I have updated the aria-expanded attribute based on the callbacks.

Also added $submenu reference to onSubmenuOpen and onSubmenuClose callbacks. Added reference to the submenu on the onSubmenuOpen() callback. Added reference to the submenu on the onSubmenuClose() callback.

Benefits

Accessibility Enhancement.

Verification Process

Open the Navigation dropdown menu item. Click on the sibling menu item. The aria-expanded value gets updated based on the openSubmenu and closeSubmenu callbacks.

Checklist:

Applicable Issues

https://github.com/10up/component-library/issues/106

cypress[bot] commented 2 years ago

Passing run #112 ↗︎

0 11 1 0 Flakiness 0

Details:

Merge a856b9efc185772165c651910ac53ebf428e32be into 9b40823739f5e4f99683651182c5...
Project: @10up/component-library Commit: a8c18874eb ℹ️
Status: Passed Duration: 00:46 💡
Started: Apr 10, 2023 7:15 AM Ended: Apr 10, 2023 7:15 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

joesnellpdx commented 2 years ago

Closing as duplicate of https://github.com/10up/component-library/pull/92

tinacastillo1 commented 1 year ago

@joesnellpdx and @ajmaurya99 this branch has a solve for the aria-expanded issues listed above that the issue it was closed in favor for does not address. Could we re-open it and get it merged in? I've had to use this fix twice in the last week.

jacobdubailcadmv commented 1 year ago

I'm also seeing this issue on the latest version (2.1.3)

ajmaurya99 commented 1 year ago

Thanks @tinacastillo1 @jacobdubailcadmv I will raise an updated PR in this week. Thanks for the report.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.46 :tada:

Comparison is base (9b40823) 66.82% compared to head (a8c1887) 67.28%.

:exclamation: Current head a8c1887 differs from pull request most recent head a856b9e. Consider uploading reports for the commit a856b9e to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #107 +/- ## =========================================== + Coverage 66.82% 67.28% +0.46% =========================================== Files 12 12 Lines 853 856 +3 Branches 196 196 =========================================== + Hits 570 576 +6 + Misses 229 228 -1 + Partials 54 52 -2 ``` | [Impacted Files](https://codecov.io/gh/10up/component-library/pull/107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up) | Coverage Δ | | |---|---|---| | [packages/navigation/src/navigation.js](https://codecov.io/gh/10up/component-library/pull/107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up#diff-cGFja2FnZXMvbmF2aWdhdGlvbi9zcmMvbmF2aWdhdGlvbi5qcw==) | `77.27% <100.00%> (+0.39%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://codecov.io/gh/10up/component-library/pull/107/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

ajmaurya99 commented 1 year ago

@tinacastillo1 @jacobdubailcadmv Could you both please confirm if this PR has the change that you were expecting. Thanks :)

jacobdubailcadmv commented 1 year ago

@tinacastillo1 @jacobdubailcadmv Could you both please confirm if this PR has the change that you were expecting. Thanks :)

This is working perfectly 😄