Skip to content

Commit

Permalink
Forward internal selection events to parents
Browse files Browse the repository at this point in the history
  • Loading branch information
t-lock committed Aug 31, 2023
1 parent 6585cd4 commit acad354
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/DatePicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@
}
}
}
/**
* Allow external sources to react to internal selections via event forwarding
*/
$: {
if ($selectedStartDate) dispatch('updateStart', $selectedStartDate.toDate())
}
$: {
if ($selectedEndDate) dispatch('updateEnd', $selectedEndDate.toDate())
}
</script>

<style>
Expand Down

0 comments on commit acad354

Please sign in to comment.