10up / component-library

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

adds menu ID to submenu ID to prevent duplicate IDs #142

Closed jacobdubailcadmv closed 1 year ago

jacobdubailcadmv commented 1 year ago

Description of the Change

Adds the parent menu ID to the submenu IDs to ensure unique IDs. This change prevents duplicate IDs.

Alternate Designs

An alternative solution is to use the Web Crypto API (randomUUID) or the UUID package.

Benefits

This change will prevent duplicate IDs on the page, which fails validation and has a11y implications, when using multiple navigation components on the same page.

Possible Drawbacks

n/a

Verification Process

I built the code npm run build and confirmed the change on a project that was affected by #141.

Checklist:

Applicable Issues

141

cypress[bot] commented 1 year ago

Passing run #120 ↗︎

0 11 1 0 Flakiness 0

Details:

Merge bee14569ecfcdb264b09409c528300aa79d7125d into 0ef0f4a2f8b691f5ebc73ea0cb73...
Project: @10up/component-library Commit: 4bf6bc594c ℹ️
Status: Passed Duration: 00:45 💡
Started: Apr 13, 2023 6:34 PM Ended: Apr 13, 2023 6:35 PM

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

codecov-commenter commented 1 year ago

Codecov Report

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

Comparison is base (9b40823) 66.82% compared to head (c534dff) 67.32%.

:exclamation: Current head c534dff differs from pull request most recent head d2c2c20. Consider uploading reports for the commit d2c2c20 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 #142 +/- ## =========================================== + Coverage 66.82% 67.32% +0.50% =========================================== Files 12 12 Lines 853 857 +4 Branches 196 196 =========================================== + Hits 570 577 +7 + Misses 229 228 -1 + Partials 54 52 -2 ``` | [Impacted Files](https://codecov.io/gh/10up/component-library/pull/142?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/142?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=10up#diff-cGFja2FnZXMvbmF2aWdhdGlvbi9zcmMvbmF2aWdhdGlvbi5qcw==) | `77.40% <100.00%> (+0.52%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://codecov.io/gh/10up/component-library/pull/142/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.