Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: [accessibility] Sidebar does not include a focusable dismiss element, trapping mobile screen readers #6761

Open
2 tasks done
6TELOIV opened this issue Feb 24, 2025 · 0 comments · May be fixed by #6798
Open
2 tasks done
Labels
bug Something isn't working

Comments

@6TELOIV
Copy link

6TELOIV commented Feb 24, 2025

Describe the bug

The sidebar does not (by default) include a button to dismiss the sidebar sheet on mobile.

This has critical accessibility implications for mobile users of screen readers, as once they are in the sidebar drawer, it is impossible to dismiss it (there is no escape key to press, and they cannot interact with any element that would cause disimissal).

The only way out I see is a hard refresh.

My recommended fix: Add a visible x dismissal button to the sidebar, as is present in the sheet component.

Affected component/components

Sidebar

How to reproduce

  1. Visit a page with a sidebar (ex: https://ui.shadcn.com/view/styles/new-york/sidebar-07)
  2. Switch to mobile view (if on desktop)
  3. Activate the sidebar
    Notice that there is no way to exit the sidebar without pressing escape or clicking the negative space next to the drawer.

On iOS or android screen readers, this makes it impossible to exit the sidebar.

Codesandbox/StackBlitz link

https://ui.shadcn.com/view/styles/new-york/sidebar-07

Logs

System Info

Android or iOS
Any Browser

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@6TELOIV 6TELOIV added the bug Something isn't working label Feb 24, 2025
@6TELOIV 6TELOIV changed the title [bug]: [accessibility] Sidebar does not include a focusable dismiss element [bug]: [accessibility] Sidebar does not include a focusable dismiss element, trapping mobile screen readers Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant