diff --git a/web/src/lib/components/elements/date-input.svelte b/web/src/lib/components/elements/date-input.svelte index e4ec4bcab8..1f621b2464 100644 --- a/web/src/lib/components/elements/date-input.svelte +++ b/web/src/lib/components/elements/date-input.svelte @@ -6,19 +6,15 @@ } export let value: $$Props['value'] = undefined; + + // Updating `value` directly causes the date input to reset itself or + // interfere with user changes. $: updatedValue = value; { - updatedValue = e.currentTarget.value; - - // Only update when value is not empty to prevent resetting the input - if (updatedValue !== '') { - value = updatedValue; - } - }} + on:input={(e) => (updatedValue = e.currentTarget.value)} on:blur={() => (value = updatedValue)} />