Skip to content

Commit

Permalink
chore: fix calendar bug caused by previous change
Browse files Browse the repository at this point in the history
  • Loading branch information
DRiFTy17 committed Jan 4, 2024
1 parent 98c9369 commit a9a410d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/lib/calendar/calendar-foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1276,23 +1276,19 @@ export class CalendarFoundation implements ICalendarFoundation {
* Moves to and sets tabindex on the given date.
* @param date The destination date
* @param setFocus Whether focus should be set on the date
* */
*/
private _goToDate(date: Date, setFocus: boolean): void {
const year = date.getFullYear();
const month = date.getMonth();
this._focusedDate = date;
if (this._year !== year || this._month !== month) {
this._month = month;
this._setMonth();
this._year = year;
this._setYear();
if (this._view !== 'date') {
this._closeMenu(false, setFocus);
} else {
this._resetDateGrid();
}
} else if (this._view !== 'date') {
this._month = month;
this._setMonth();
this._year = year;
this._setYear();
if (this._view !== 'date') {
this._closeMenu(false, setFocus);
} else {
this._resetDateGrid();
}
this._adapter.setActiveDate(date, setFocus, this._preventFocus);
this._emitFocusChangeEvent(this._focusedDate);
Expand Down

0 comments on commit a9a410d

Please sign in to comment.