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 }, );