FocusTrap for Dialog
I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior When you open a dialog - or even a modal - and tab through its elements, you end up focusing elements in the background when there are no more focusable elements in the dialog itself.
Expected behavior Tabbing inside a dialog should cycle only on elements inside the dialog. For example, Angular Material's FocusTrap does it. Also, opening a dialog should focus its first focusable element, and closing it should focus whatever element in the background was focused before opening.
What is the motivation / use case for changing the behavior? Avoiding unexpected behaviour, giving logic consistency.
btw, i'm using import {A11yModule} from '@angular/cdk/a11y'; from Material in my PNG project and in dialog content
<div class="my-inner-dialog-content" cdkTrapFocus> works great!
Disadvantage, of course, increased bundle size, but this
Avoiding unexpected behaviour, giving logic consistency
Has this been implemented? Facing this issue in PrimeNG v6 as well.