Skip to content

fix(toggle-group): use group aria role by default - #3595

Open
michal-sanoma wants to merge 2 commits into
mainfrom
fix/2912_toggle_group_role_group
Open

fix(toggle-group): use group aria role by default#3595
michal-sanoma wants to merge 2 commits into
mainfrom
fix/2912_toggle_group_role_group

Conversation

@michal-sanoma

@michal-sanoma michal-sanoma commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Change the default semantic role of sl-toggle-group from region to group
  • Preserve explicitly provided roles, such as role="toolbar"
  • Add regression tests for the default role and explicit role handling

Why

role="region" exposes the toggle group as a landmark, which is intended for important page sections. A toggle group is a set of related controls, so role="group" better communicates its purpose to assistive technologies

BEFORE

Screenshot 2026-08-13 at 14 43 00

AFTER

Screenshot 2026-08-13 at 14 43 44

@michal-sanoma michal-sanoma self-assigned this Aug 13, 2026
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1a522df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@sl-design-system/toggle-group Patch
@sl-design-system/grid Patch
@sl-design-system/tool-bar Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@michal-sanoma
michal-sanoma requested a balanced review from Copilot August 13, 2026 12:44
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates toggle-group accessibility semantics while preserving explicit roles.

Changes:

  • Defaults toggle groups to role="group".
  • Preserves roles supplied during connection.
  • Adds regression tests and a patch changeset.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
toggle-group.ts Updates default ARIA role behavior.
toggle-group.spec.ts Tests default and explicit roles.
.changeset/bumpy-teeth-begin.md Documents the patch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/components/toggle-group/src/toggle-group.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@a11ymiko
a11ymiko marked this pull request as ready for review August 14, 2026 09:16
@michal-sanoma michal-sanoma linked an issue Aug 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Toggle group] Use role="group" for a set off toggles

3 participants