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:
parent
9125999d1a
commit
52a52f9f40
1 changed files with 4 additions and 8 deletions
|
@ -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)}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue