angular / angular/components

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

Aperta
#13,054 11 commenti 9 reazioni 1 assegnatario Rivendicata da @annieyw Vedi su GitHub
Accessibility area: cdk/overlay area: material/dialog P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### 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)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.