diff --git a/web/src/lib/components/elements/date-input.svelte b/web/src/lib/components/elements/date-input.svelte new file mode 100644 index 0000000000..e4ec4bcab8 --- /dev/null +++ b/web/src/lib/components/elements/date-input.svelte @@ -0,0 +1,24 @@ + + + { + updatedValue = e.currentTarget.value; + + // Only update when value is not empty to prevent resetting the input + if (updatedValue !== '') { + value = updatedValue; + } + }} + on:blur={() => (value = updatedValue)} +/> diff --git a/web/src/lib/components/faces-page/set-birth-date-modal.svelte b/web/src/lib/components/faces-page/set-birth-date-modal.svelte index 415f5c0f76..717b88d031 100644 --- a/web/src/lib/components/faces-page/set-birth-date-modal.svelte +++ b/web/src/lib/components/faces-page/set-birth-date-modal.svelte @@ -4,6 +4,7 @@ import FullScreenModal from '../shared-components/full-screen-modal.svelte'; import { mdiCake } from '@mdi/js'; import Icon from '$lib/components/elements/icon.svelte'; + import DateInput from '../elements/date-input.svelte'; export let birthDate: string; @@ -37,7 +38,7 @@