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

[A11Y] App drawer on mobile is still part of accessibility tree when hidden #2565

Closed
Tracked by #3360
davwheat opened this issue Jan 25, 2021 · 0 comments · Fixed by #2666
Closed
Tracked by #3360

[A11Y] App drawer on mobile is still part of accessibility tree when hidden #2565

davwheat opened this issue Jan 25, 2021 · 0 comments · Fixed by #2666
Assignees
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)

Comments

@davwheat
Copy link
Member

Bug Report

Current Behavior
The app drawer on mobile is still part of the accessibility tree and can be tabbed into even when it's not shown.

Steps to Reproduce

  1. Open Flarum and shrink browser viewport
  2. Press tab to cycle through elements
  3. Elements in the drawer (e.g. home link, user dropdown, etc) will be focused

Expected Behavior
Elements that are off-screen shouldn't be part of the accessibility tree, and shouldn't be able to be tabbed into.

Environment

  • Flarum version: 0.1.0-beta.15
  • Webserver: Apache
  • Browser: Chrome 87

Possible Solution
visibility: hidden should be added to the .App-drawer when it's off-screen. This can be added to the styles as .App:not(.drawerOpen) .App-drawer.

The issue with this is that it breaks the drawer close animation. The way around this is to set visibility: visible when the user begins to close the drawer, then use an event handler in JS (transitionend, supported IE10+) to remove this inline style.

This also handles removing it from the accessibility tree as screen-readers ignore elements with visibility: hidden.

If you have any better ideas, please let me know.

@davwheat davwheat changed the title [a11y] App drawer on mobile is still part of accessibility tree when hidden [A11Y] App drawer on mobile is still part of accessibility tree when hidden Mar 14, 2021
@davwheat davwheat self-assigned this Mar 14, 2021
@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Mar 15, 2021
SychO9 pushed a commit that referenced this issue Mar 18, 2021
…rts (#2666)

* Fix nav drawer being focusable when off-screen on small viewports

Fixes #2565

* Implement review suggestions

* Format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant