We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e82ff91 commit b25283cCopy full SHA for b25283c
src/cdk/a11y/focus-trap/event-listener-inert-strategy.ts
@@ -52,8 +52,7 @@ export class EventListenerFocusTrapInertStrategy implements FocusTrapInertStrate
52
53
// Don't refocus if target was in an overlay, because the overlay might be associated
54
// with an element inside the FocusTrap, ex. mat-select.
55
- if (target && !focusTrapRoot.contains(target) &&
56
- target.closest('div.cdk-overlay-pane') === null) {
+ if (target && !focusTrapRoot.contains(target) && !target.closest?.('div.cdk-overlay-pane')) {
57
// Some legacy FocusTrap usages have logic that focuses some element on the page
58
// just before FocusTrap is destroyed. For backwards compatibility, wait
59
// to be sure FocusTrap is still enabled before refocusing.
0 commit comments