From 0b510f7b73ae1a02531905d03527c1bdd53e345e Mon Sep 17 00:00:00 2001 From: mdlufy Date: Fri, 13 Sep 2024 13:51:55 +0300 Subject: [PATCH] fix(kit): `CalendarRange` shows actual `defaultViewedMonth` --- .../primitive-calendar-range.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts b/projects/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts index e05159e0a046..037f4fd8f43c 100644 --- a/projects/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts +++ b/projects/kit/internal/primitive-calendar-range/primitive-calendar-range.component.ts @@ -5,6 +5,7 @@ import { EventEmitter, Inject, Input, + OnChanges, OnInit, Optional, Output, @@ -37,7 +38,7 @@ import {takeUntil} from 'rxjs/operators'; changeDetection: ChangeDetectionStrategy.OnPush, providers: [TuiDestroyService], }) -export class TuiPrimitiveCalendarRangeComponent implements OnInit { +export class TuiPrimitiveCalendarRangeComponent implements OnInit, OnChanges { @Input() disabledItemHandler: TuiBooleanHandler = ALWAYS_FALSE_HANDLER; @@ -99,6 +100,10 @@ export class TuiPrimitiveCalendarRangeComponent implements OnInit { monthOffset: TuiTypedMapper<[TuiMonth, number], TuiMonth> = (value, offset) => value.append({month: offset}); + ngOnChanges(): void { + this.setInitialMonths(); + } + ngOnInit(): void { this.setInitialMonths(); }