Skip to content

High performance self-hosted photo and video management solution.

fix(web): date input on chrome (#7669)

Michel Heusschen52a52f9f4006
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;
</script>
<input
{...$$restProps}
{value}
- on:input={(e) => {
- 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)}
/>