Skip to content

Commit cc9561f

Browse files
Fix browseWithoutSelecting when date is selected
Fix browsing not working with `browseWithoutSelecting` when a date is selected
1 parent 4830bd5 commit cc9561f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Next
4+
- Fix browsing not working with `browseWithoutSelecting` when a date is selected
5+
36
## 2.4.0 - 2023 Apr 29
47
- Add `class` prop (@jdtjenkins)
58
- Fix vite-plugin-svelte resolve config conflict warning

src/lib/DatePicker.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
3636
/** The date shown in the popup when none is selected */
3737
let browseDate = value ? cloneDate(value) : cloneDate(defaultDate)
38-
$: if (browseDate.getTime() !== value?.getTime()) {
38+
$: if (browseDate.getTime() !== value?.getTime() && !browseWithoutSelecting) {
3939
browseDate = value ? cloneDate(value) : browseDate
4040
}
4141
@@ -77,8 +77,6 @@
7777
$: browseYear = browseDate.getFullYear()
7878
function setYear(newYear: number) {
7979
browseDate.setFullYear(newYear)
80-
/* eslint-disable-next-line no-self-assign */
81-
browseDate = browseDate
8280
browse(browseDate)
8381
}
8482

0 commit comments

Comments
 (0)