PrimeNG v18 Nested Dialog focus restoration still unreliable
0 reputation · 21 Jan 2020, 18:32 UTC
Goal
Ensure that when a child Dialog is closed, focus returns to the element that opened the parent Dialog, satisfying WCAG 2.4.3.
Current Behavior
PrimeNG v18 captures the active element at Dialog open time. In nested scenarios, the captured element is the child Dialog’s trigger, not the parent’s trigger button. Closing the child leaves focus on the parent Dialog or a random element, breaking the focus order.
Constraints
Global providePrimeNG({ accessibility: { focusTrap: false } }) does not affect this; the issue persists even when focusTrap is enabled. The component‑level focusTrap flag is respected for the outer Dialog but is ignored for the inner one.
Questions
- What configuration or component pattern can guarantee focus restoration to the original trigger in nested Dialogs?
- Does PrimeNG plan to expose a dedicated
focusRestoreoption for Dialogs in v19? - Is there a known workaround using Angular
ViewChildor a customFocusTrapservice that aligns with the current signal‑based change detection?