angular / angular/components

Controls below the angular material dialog overlay still can be focused by keyboard

Ouverte
#13,054 11 commentaires 9 réactions 1 personne assignée Réclamée par @annieyw Voir sur GitHub
Accessibility area: cdk/overlay area: material/dialog P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
The dialog should be completely modal.

#### What is the current behavior?
Controls that are below in z-order of the Angular Material dialog overlay still can be focused by keyboard.

#### What are the steps to reproduce?
- Go to the stock Angular Material Dialog example: https://material.angular.io/components/dialog/examples
- Close the Dev Tools if it been opened earlier (this will just allow less TABs to press later, see below)
- Click on the Pick One button, the dialog pops up
- Click the browser address tab (Chrome on Windows been used for test)
- Start pressing TAB on the keyboard - you will notice that controls underneath the dialog overlay are getting selected, with all keyboard interaction enabled for the selected control. E.g. it's possible to enter new values into text boxes, press buttons etc.

Out of curiosity I also checked Bootstrap Modal - it also got similar problem, but for that one Shift-TAB needs to be pressed to reproduce.

As a suggestion - I understand that the dialog overlay is currently based on cdkTrapFocus directive. This one is suffering from the same problem, I presume it's exactly same problem, so it would be nice to fix it on the level of cdkTrapFocus - because the focus trap is quite useful thing.

![image](https://user-images.githubusercontent.com/5769929/45272711-36d7d580-b4f2-11e8-912a-b375f4694450.png)

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.