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

[Accessibility] Overlay DOM position breaks screen reader focus order #10302

Open
dgfranklin opened this issue Mar 7, 2018 · 3 comments
Open
Labels
area: cdk/a11y area: cdk/overlay feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@dgfranklin
Copy link

Bug

When an overlay is opened, it is inserted into the overlay container at the end of the document body. While one can control the tab-focus, particularly through the use of a focus-trap, it is difficult to control the screen-reader focus order. This came up in #7787, which was fixed (but only for dialogs), by making the rest of the page aria-hidden.

What is the expected behavior?

There should be at least two types of ways to handle focus on overlays, exemplified by certain Material components:

  1. The "dialog" mode: A focus-trap is applied to the overlay, and the rest of the page is inaccessible while the overlay is displayed, with or without a screen reader.
  2. The "menu" mode: An overlay is opened "in-line" on the page. The user should be able to move into and out of the overlay as if the DOM were next to the overlay origin.

What is the current behavior?

Mode 1 was fixed for dialog in #9016, but isn't easily accessible to custom overlays. I could copy the code over, but it would be nicer if the overlay service had a means to handle it.

Mode 2 does not exist. If you shift focus backwards in a screen reader when a component like MatMenu creates an overlay, it brings you to the bottom of the page instead of to the flyout origin.

What are the steps to reproduce?

Focusing on Mode 2 on the menu component, look at the provided MatMenu demo in StackBlitz:
https://stackblitz.com/angular/qyybdrnxmyx with a screen reader. (I've tested this on Chrome with VoiceOver on macOS so far, but I expect this effects most).

  1. Click "Menu". The screen reader focus is moved to Item 1.
  2. Navigate back (ctrl+option+left). This moves to the menu itself (no problem there).
  3. Navigate back again. This moves focus to "Current build: ...." instead of the original Menu button. On a larger page, this problem will be made worse by all the other elements in between.

What is the use-case or motivation for changing an existing behavior?

Improved accessibility.

Is there anything else we should know?

This affects an internal Google product.

@josephperrott josephperrott added feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Mar 26, 2018
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 1, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 22, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@ttma1046
Copy link

Hi, any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/a11y area: cdk/overlay feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants