fix: add role="region" to stack layout div with aria-label for WCAG 2.2 compliance#18
Open
iago1501 wants to merge 1 commit into
Open
fix: add role="region" to stack layout div with aria-label for WCAG 2.2 compliance#18iago1501 wants to merge 1 commit into
iago1501 wants to merge 1 commit into
Conversation
….2 compliance The div rendered by stack-layout uses aria-label without an explicit role. Per ARIA 1.2, aria-label is a prohibited attribute on elements with the implicit role="generic" (the default for a div), which is a WCAG 2.2 Level A (4.1.2 Name, Role, Value) violation flagged by an external audit on the kohlerqa account. role="region" makes the element a valid landmark that accepts an accessible name.
|
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.
|
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
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"to the stack layout<div>that containsaria-label, fixing an accessibility violation identified in an external audit for the kohlerqa account.Why is this needed?
The current implementation uses
aria-labelon a<div>without an explicitroleattribute. According to the ARIA 1.2 specification,aria-labelis a prohibited attribute on elements with the implicitrole="generic"(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/index.tsx- Addedrole="region"to the main stack 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