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] Fix nav drawer being focusable when off-screen on small viewports #2666

Merged
merged 3 commits into from
Mar 18, 2021
Merged

[A11Y] Fix nav drawer being focusable when off-screen on small viewports #2666

merged 3 commits into from
Mar 18, 2021

Conversation

davwheat
Copy link
Member

@davwheat davwheat commented Mar 7, 2021

Fixes #2565
Progresses towards completion of #3360

Changes proposed in this pull request:

  • Implements visibility: hidden on mobile when the drawer is not open.
  • Adds inline visibility: visible as drawer exits.
  • Removes inline style to re-apply visibility: hidden once transition is complete.

In the GIFs below, keep an eye on the watched variables in the dev console to see the effect of the change.

Before

LKOf0u

After

TpPNeQ

Confirmed

  • Frontend changes: tested on a local Flarum installation.

@davwheat davwheat changed the title Fix nav drawer being focusable when off-screen on small viewports [A11Y] Fix nav drawer being focusable when off-screen on small viewports Mar 7, 2021
@davwheat davwheat self-assigned this Mar 15, 2021
@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Mar 15, 2021
less/common/App.less Outdated Show resolved Hide resolved
Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Works well, left a few minor code comments

js/src/common/utils/Drawer.js Outdated Show resolved Hide resolved
js/src/common/utils/Drawer.js Outdated Show resolved Hide resolved
Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Excellent!

@dsevillamartin
Copy link
Member

I'm not comfortable enough with combining JS & CSS code for animations (I struggled a lot with Composer open & close animation in my mithril 2 branch) 🙈

If it works and doesn't break other things (which it doesn't look to me like it would), I'm fine with it.

Copy link
Member

@SychO9 SychO9 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@SychO9 SychO9 merged commit 0cc12ae into flarum:master Mar 18, 2021
@davwheat davwheat deleted the dw/2565-remove-drawer-from-a11y-tree branch March 18, 2021 22:03
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 this pull request may close these issues.

[A11Y] App drawer on mobile is still part of accessibility tree when hidden
4 participants