-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
DomHandler: getFocusableElements returns elements with hidden parents #14691
Comments
I can add a Stackblitz if 100% necessary. |
Hi, Yes, could you please share a stackblitz also, so we can identify the issue clearly? |
Hopefully this Stackblitz reproduces the issue clearly. |
…ents-ancestors-display-none Fix #14691 DomHandler.getFocusableElements returns visible elements
Hi, Thanks for reporting the issue and the PR but it caused errors in some of the components. For example; tab functionality throws console errors in dropdown. Probably it's same in the multiselect, autocomplete etc. Reverting the PR and re-opening the issue. Moving the issue to the 17.Future. |
…ocusableElements-ancestors-display-none Revert "Fix #14691 DomHandler.getFocusableElements returns visible elements"
@cetincakiroglu sorry about that -- it looks like it was the dropdowns with virtual scroll that were causing the issue? My new PR fixes this issue without breaking those. I was calling |
…cusableElements Fix #14691 DomHandler.getFocusableElements should return only visible els
Describe the bug
DomHandler.getFocusableElements checks the display and visibility of each element itself but doesn't account for ancestors with
display: none
. This results in unexpected behavior when tabbing in, for example, a dialog box with focus trap enabled.Environment
Angular 17.0.8
Reproducer
No response
Angular version
17.0.8
PrimeNG version
17.3.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.19.0
Browser(s)
No response
Steps to reproduce the behavior
display: none
Expected behavior
An element that is not displayed because its parent has
display: none
shouldn't be eligible for focus and thus should be excluded from the results.The text was updated successfully, but these errors were encountered: