fix(panel): Fix collapsed Panel content being exposed to screen readers#3365
Merged
michal-sanoma merged 1 commit intoMay 21, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: b1ed79f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an accessibility issue in sl-panel where visually collapsed content could still be reached by assistive technologies. It ensures collapsed panel content is removed from the accessibility tree and is not focusable/navigable until the panel is expanded again.
Changes:
- Add
inertand conditionalaria-hidden="true"to the panel body when a collapsible panel is collapsed, and remove them when expanded. - Add regression tests covering both toggling to collapsed/expanded and initially-collapsed panels.
- Add a changeset to publish the fix as a patch for
@sl-design-system/panel.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/components/panel/src/panel.ts | Applies inert + aria-hidden to collapsed collapsible panel body to prevent AT/focus access. |
| packages/components/panel/src/panel.spec.ts | Adds regression tests verifying attributes are applied/removed correctly and on initial collapsed render. |
| .changeset/stupid-drinks-refuse.md | Publishes a patch noting the accessibility fix. |
Contributor
🕸 Storybook previewYou can view a preview here (commit |
a11ymiko
approved these changes
May 21, 2026
anna-lach
reviewed
May 21, 2026
anna-lach
approved these changes
May 21, 2026
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.
Summary
This PR fixes an accessibility issue in collapsible sl-panel variants where screen reader users could navigate into visually collapsed panel content.
Changes:
BEFORE
before.mov
AFTER
after.mov