Skip to content

Commit

Permalink
Fix browseWithoutSelecting when date is selected
Browse files Browse the repository at this point in the history
Fix browsing not working with `browseWithoutSelecting` when a date is selected
  • Loading branch information
probablykasper committed Apr 29, 2023
1 parent 4830bd5 commit cc9561f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/lib/DatePicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit cc9561f

Please sign in to comment.