diff --git a/CHANGELOG.md b/CHANGELOG.md index e13a0e1..6b9f074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Next +- Fix browsing not working with `browseWithoutSelecting` when a date is selected + ## 2.4.0 - 2023 Apr 29 - Add `class` prop (@jdtjenkins) - Fix vite-plugin-svelte resolve config conflict warning diff --git a/src/lib/DatePicker.svelte b/src/lib/DatePicker.svelte index f742cf0..bf86f60 100644 --- a/src/lib/DatePicker.svelte +++ b/src/lib/DatePicker.svelte @@ -35,7 +35,7 @@ /** The date shown in the popup when none is selected */ let browseDate = value ? cloneDate(value) : cloneDate(defaultDate) - $: if (browseDate.getTime() !== value?.getTime()) { + $: if (browseDate.getTime() !== value?.getTime() && !browseWithoutSelecting) { browseDate = value ? cloneDate(value) : browseDate } @@ -77,8 +77,6 @@ $: browseYear = browseDate.getFullYear() function setYear(newYear: number) { browseDate.setFullYear(newYear) - /* eslint-disable-next-line no-self-assign */ - browseDate = browseDate browse(browseDate) }