Fix usage of binding values to datepickers

This commit is contained in:
Andrew Kingston 2021-10-19 14:04:12 +01:00
parent f5f2611a3e
commit 7d31e29b47
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<script>
import Field from "./Field.svelte"
import DatePicker from "./Core/DatePicker.svelte"
import { createEventDispatcher } from "svelte"
export let value = null
export let label = null
@ -10,6 +11,13 @@
export let enableTime = true
export let placeholder = null
export let appendTo = undefined
const dispatch = createEventDispatcher()
const onChange = e => {
value = e.detail
dispatch("change", e.detail)
}
</script>
<Field {label} {labelPosition} {error}>
@ -20,6 +28,6 @@
{placeholder}
{enableTime}
{appendTo}
on:change
on:change={onChange}
/>
</Field>