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

Keyboard focus is not managed when dialogs close #15321

Closed
karlgroves opened this issue Apr 30, 2019 · 3 comments
Closed

Keyboard focus is not managed when dialogs close #15321

karlgroves opened this issue Apr 30, 2019 · 3 comments
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress

Comments

@karlgroves
Copy link

Keyboard focus is not managed when dialogs close

  • Severity: Medium
  • Affected Populations:
    • Blind
    • Low-Vision
    • Motor Impaired
    • Cognitively Impaired
  • Platform(s):
    • All / Universal
  • Components affected:
    • Tools and Options

Issue description

When the "Keyboard Shortcuts" and "Options" dialogs are dismissed,
the keyboard focus is reset to the top of the page. This may be
confusing or inconvenient for users, who would expect the focus to
return to the last element they were focused on.

Keyboard and screen reader users rely on predictable and consistent
focus control to navigate the page. When this is absent, users may find
it much more difficult or impossible to navigate using the keyboard.

Remediation Guidance

Ideally, use JavaScript to continually track the keyboard focus
position, so that when dialogs are opened via shortcut keys, the focus
can be returned to the previously-focused element when they close.

If that's not practical, then closing these dialogs should set focus on
the "Tools and Options" button.

Relevant standards

Note: This issue may be a duplicate with other existing accessibility-related bugs in this project. This issue comes from the Gutenberg accessibility audit, performed by Tenon and funded by WP Campus. This issue is GUT-53 in Tenon's report

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Apr 30, 2019
@melchoyce
Copy link
Contributor

Screenshot from full report:

image

@afercia
Copy link
Contributor

afercia commented May 5, 2019

In these cases focus should always be moved back to the "invoking context", ie. the button that toggled the modal. When invoking modals from buttons in the "More" menu:

Screenshot 2019-05-05 at 18 15 09

this was impossible because the More menu then closed, thus the invoking button disappeared.

As far as I can tell, this has been mitigated with the recent introduction of the onFocusLoss option in #14444. Now, focus is moved back to the "Tools and Options" button if that was the invoking context.

Notable exception: the datepicker popup, see #15329.

Worth investigating other edge cases of focus loss.

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed Needs Accessibility Feedback Need input from accessibility labels May 5, 2019
@gziolo gziolo self-assigned this Aug 8, 2019
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Aug 8, 2019
@gziolo
Copy link
Member

gziolo commented Sep 19, 2019

It was fixed in #16964.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

No branches or pull requests

5 participants