Skip to content

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
masterfrom
fix/add-role-region-aria-label
Open

fix: add role="region" to stack layout div with aria-label for WCAG 2.2 compliance#18
iago1501 wants to merge 1 commit into
masterfrom
fix/add-role-region-aria-label

Conversation

@iago1501

@iago1501 iago1501 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds role="region" to the stack layout <div> that contains aria-label, fixing an accessibility violation identified in an external audit for the kohlerqa account.

Why is this needed?

The current implementation uses aria-label on a <div> without an explicit role attribute. According to the ARIA 1.2 specification, aria-label is a prohibited attribute on elements with the implicit role="generic" (the default for <div> elements).

This violates:

  • WCAG 2.2 Level A - Criterion 4.1.2 (Name, Role, Value)
  • ARIA 1.2 specification - aria-label prohibited on generic role elements

How does this fix it?

By adding role="region", the element becomes a proper landmark that:

  • Accepts accessible names via aria-label
  • Is semantically appropriate for layout sections
  • Complies with ARIA 1.2 and WCAG 2.2 Level A standards

What changed?

Files modified:

  • react/index.tsx - Added role="region" to the main stack layout div
  • CHANGELOG.md - Added entry for this fix

Testing

This change maintains backward compatibility and does not affect functionality - it only improves accessibility compliance.

Related PRs

References

….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.
@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jul 3, 2026

Copy link
Copy Markdown

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:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot

vtex-io-docs-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@iago1501 iago1501 self-assigned this Jul 3, 2026
@iago1501 iago1501 added the enhancement New feature or request label Jul 3, 2026
@iago1501 iago1501 requested a review from gabpaladino July 3, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant