diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 9f25f9cc4..890ab9076 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -19,8 +19,7 @@ >
@@ -179,6 +180,7 @@ let transitionDuration = $computed(() => let contentClicking = false; +const focusedElement = document.activeElement; function close(ev, opts: { useSendAnimation?: boolean } = {}) { // removeEventListener("popstate", close); // if (props.preferType == "dialog") { @@ -192,6 +194,9 @@ function close(ev, opts: { useSendAnimation?: boolean } = {}) { if (props.src) props.src.style.pointerEvents = "auto"; showing = false; emit("close"); + if (!props.noReturnFocus) { + focusedElement.focus(); + } } function onBgClick() {