ng-bootstrap / ng-bootstrap

Angular powered Bootstrap

Home Page:https://ng-bootstrap.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modal a11y, focus traps from focusing iframe elements

RimtasDede opened this issue · comments

Bug description:

I use ng-bootstrap modal and inside modal content have iframe'd separate application. Modal have only close button focusable element.

Link to minimally-working StackBlitz that reproduces the issue:

https://ng-bootstrap-modals-fmgwdl.stackblitz.io/

Open modal and press TAB couple times: Focus is trapped on modal close button even if iframe have some focusable elements inside.

What do you think guys, is this a issue/bug and this should be fixed or this modal+iframe combination is irelevant? I know that iframes isint a good practice, but cant avoid iframe at this moment and looking for how this can be solved in better way.

ng-bootstrap focus trap util find focusable elements only in same document (in this case first and last focusable element is modal close button). Maybe it would be good to implement at least 1 iframe document deep focusable scan?

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 17.3.8

ng-bootstrap: 16.0.0

Bootstrap: 5.2.0