Fix usage of binding values to datepickers
This commit is contained in:
parent
f5f2611a3e
commit
7d31e29b47
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue