diff --git a/src/components/NcModal/NcModal.vue b/src/components/NcModal/NcModal.vue index fdfd9b5ddc..64887f67e8 100644 --- a/src/components/NcModal/NcModal.vue +++ b/src/components/NcModal/NcModal.vue @@ -799,6 +799,10 @@ export default { setReturnFocus: this.setReturnFocus, } + this.externalFocusTrapStack = [...getTrapStack()] + for (const trap of this.externalFocusTrapStack) { + trap.deactivate() + } // Init focus trap this.focusTrap = createFocusTrap([contentContainer, ...this.additionalTrapElements], options) this.focusTrap.activate() @@ -809,6 +813,9 @@ export default { } this.focusTrap?.deactivate() this.focusTrap = null + for (const trap of this.externalFocusTrapStack) { + trap.activate() + } }, },