fix: add role="region" to flex layout div with aria-label for WCAG 2.2 compliance#75
Open
iago1501 wants to merge 3 commits into
Open
fix: add role="region" to flex layout div with aria-label for WCAG 2.2 compliance#75iago1501 wants to merge 3 commits into
iago1501 wants to merge 3 commits into
Conversation
…2 compliance Adds role="region" attribute to the flex layout div that contains aria-label to comply with: - WCAG 2.2 Level A criterion 4.1.2 (Name, Role, Value) - ARIA 1.2 specification (aria-label is prohibited on elements with implicit role="generic") The role="region" landmark is semantically appropriate for layout sections and allows proper use of aria-label as an accessible name.
Contributor
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Previous commit accidentally truncated the changelog. This commit restores all historical entries while keeping the new accessibility fix entry in [Unreleased].
Complete fix restoring missing last line "- `flex-row` and `flex-col` blocks."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
role="region"attribute to the flex layout<div>element that containsaria-labelto fix an accessibility violation identified in external audit for kohlerqa account.Why is this needed?
The current implementation uses
aria-labelon a<div>without an explicitroleattribute. According to ARIA 1.2 specification,aria-labelis a prohibited attribute on elements with implicitrole="generic"(which is the default for<div>elements).This violates:
How does this fix it?
By adding
role="region", the element becomes a proper landmark that:aria-labelWhat changed?
Files modified:
react/FlexLayout.tsx- Addedrole="region"to the main flex layout divCHANGELOG.md- Added entry for this fixTesting
This change maintains backward compatibility and does not affect functionality - it only improves accessibility compliance.
Related PRs
References