From e266cc0b9928e368914b877834563bc0e253c8bb 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 029e03939..bc4478def 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 = () => {