diff --git a/frontend/src/lib/components/toolbox/toolbox-tools-dropdown.vue b/frontend/src/lib/components/toolbox/toolbox-tools-dropdown.vue index 5fa36b4b..d5028ffc 100644 --- a/frontend/src/lib/components/toolbox/toolbox-tools-dropdown.vue +++ b/frontend/src/lib/components/toolbox/toolbox-tools-dropdown.vue @@ -107,10 +107,12 @@ @hidden="dialog = undefined" > - + + + , { onShown, onHi } }); - watch(modalRef, (newRef, oldRef, onCleanup_) => { + const isActivated = ref(true); + onActivated(() => { + isActivated.value = true; + }); + onDeactivated(() => { + isActivated.value = false; + }); + + watchEffect((onCleanup_) => { const onCleanup = fixOnCleanup(onCleanup_); - if (newRef) { + if (modalRef.value && isActivated.value) { + const newRef = modalRef.value; + if (!lastFocusedEl) { lastFocusedEl = document.activeElement ?? undefined; }