From 715f7a7a1a0ca1e7898fcbc7c3dc25952c20fd96 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Sat, 10 Jun 2023 20:30:26 -0400 Subject: [PATCH] fixes --- packages/client/src/components/MkDialog.vue | 2 -- packages/client/src/components/MkModal.vue | 4 ++-- packages/client/src/os.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/MkDialog.vue b/packages/client/src/components/MkDialog.vue index c3d0ccb3b7..d6c671f8d5 100644 --- a/packages/client/src/components/MkDialog.vue +++ b/packages/client/src/components/MkDialog.vue @@ -338,7 +338,6 @@ async function openSearchFilters(ev) { os.inputDate({ title: "Posts before" }).then((res) => { - inputEl.value.focus(); if (res.canceled) return; inputValue.value += " before:" + res.result; }); @@ -351,7 +350,6 @@ async function openSearchFilters(ev) { os.inputDate({ title: "Posts after" }).then((res) => { - inputEl.value.focus(); if (res.canceled) return; inputValue.value += " after:" + res.result; }); diff --git a/packages/client/src/components/MkModal.vue b/packages/client/src/components/MkModal.vue index 6176298fa3..7b12facca9 100644 --- a/packages/client/src/components/MkModal.vue +++ b/packages/client/src/components/MkModal.vue @@ -194,14 +194,14 @@ function close(ev, opts: { useSendAnimation?: boolean } = {}) { if (props.src) props.src.style.pointerEvents = "auto"; showing = false; emit("close"); - if (!noReturnFocus) { + if (!props.noReturnFocus) { focusedElement.focus(); } } function onBgClick() { if (contentClicking) return; - if (!noReturnFocus) { + if (!props.noReturnFocus) { focusedElement.focus(); } emit("click"); diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index d1e7c36733..6a96b83fea 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -492,7 +492,7 @@ export function inputDate(props: { { done: (result) => { resolve( - result + (result && isFinite(new Date(result.result))) ? { result: new Date(result.result), canceled: false } : { canceled: true }, );