diff --git a/projects/kit/components/calendar-range/calendar-range.component.ts b/projects/kit/components/calendar-range/calendar-range.component.ts index 6efc986411fc..e251c181bddd 100644 --- a/projects/kit/components/calendar-range/calendar-range.component.ts +++ b/projects/kit/components/calendar-range/calendar-range.component.ts @@ -96,7 +96,7 @@ export class TuiCalendarRange implements OnInit, OnChanges { ?.pipe(tuiWatch(inject(ChangeDetectorRef)), takeUntilDestroyed()) .subscribe((value) => { this.value = value; - this.defaultViewedMonth = this.value?.to ?? this.defaultViewedMonth; + this.initDefaultViewedMonth(); }); } @@ -179,12 +179,13 @@ export class TuiCalendarRange implements OnInit, OnChanges { this.selectedActivePeriod = item; this.updateValue(item.range.dayLimit(this.min, this.max)); this.itemChange.emit(item); - this.defaultViewedMonth = this.value?.to ?? this.defaultViewedMonth; } else if (this.activePeriod !== null) { this.selectedActivePeriod = null; this.updateValue(null); this.itemChange.emit(null); } + + this.initDefaultViewedMonth(); } protected onMonthChange(month: TuiMonth): void {