Skip to content

Commit

Permalink
fix(core): fixed range date picker premature value update (#10757)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-cheishvili authored Oct 19, 2023
1 parent 0e440a3 commit da4b65d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions libs/core/src/lib/date-picker/date-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,16 @@ export class DatePickerComponent<D>
const endChanged = !this._dateTimeAdapter.datesEqual(dates.end, this.selectedRangeDate.end);
if (dates && (startChanged || endChanged)) {
const shouldClose = this.closeOnDateChoose && dates.end !== null;
this._inputFieldDate = this._formatDateRange(dates);
this.selectedRangeDate = {
start: dates.start,
end: dates.end
};
this.selectedRangeDateChange.emit(this.selectedRangeDate);
this.onChange(this.selectedRangeDate);
this._isInvalidDateInput = !this.isModelValid();
if (dates.end !== null) {
this._inputFieldDate = this._formatDateRange(dates);
this.selectedRangeDate = {
start: dates.start,
end: dates.end
};
this.selectedRangeDateChange.emit(this.selectedRangeDate);
this.onChange(this.selectedRangeDate);
this._isInvalidDateInput = !this.isModelValid();
}
if (shouldClose) {
this.closeCalendar();
}
Expand Down

0 comments on commit da4b65d

Please sign in to comment.