1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-06 03:46:47 +01:00

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

This commit is contained in:
Michel Heusschen 2024-03-06 12:47:15 +01:00 committed by GitHub
parent 9125999d1a
commit 52a52f9f40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,19 +6,15 @@
} }
export let value: $$Props['value'] = undefined; export let value: $$Props['value'] = undefined;
// Updating `value` directly causes the date input to reset itself or
// interfere with user changes.
$: updatedValue = value; $: updatedValue = value;
</script> </script>
<input <input
{...$$restProps} {...$$restProps}
{value} {value}
on:input={(e) => { on:input={(e) => (updatedValue = e.currentTarget.value)}
updatedValue = e.currentTarget.value;
// Only update when value is not empty to prevent resetting the input
if (updatedValue !== '') {
value = updatedValue;
}
}}
on:blur={() => (value = updatedValue)} on:blur={() => (value = updatedValue)}
/> />