From 655094062583fc16a716352314ea47a3c088a7a0 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Sun, 12 Feb 2023 20:49:41 -0500 Subject: [PATCH] Focus last element when exiting modal --- packages/client/src/components/MkModal.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 029e039397..bc4478def3 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -77,10 +77,12 @@ const type = $computed(() => { let contentClicking = false; +const focusedElement = document.activeElement; const close = () => { if (props.src) props.src.style.pointerEvents = 'auto'; showing = false; emit('close'); + focusedElement.focus(); }; const onBgClick = () => {