Calendar component: date input value is removed when a date before mindDate is entered #15487
Labels
LTS-PORTABLE
Issue's fix will be ported to supported LTS versions
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When I type a date in the inputfield before the minDate, the complete input is erased. Before PrimeNG 17.16.0, the input remained in the inputfield and was shown as invalid (red border). It happens here:
primeng/src/app/components/calendar/calendar.ts
Line 1605 in 1594516
Environment
<p-calendar
#calendar
dateMask
(inputMaskValid)="handleInput($event)"
(onSelect)="handleCalendarSelect($event)"
[(ngModel)]="date"
(ngModelChange)="onChange($event)"
[keepInvalid]="true"
[showOnFocus]="false"
[showWeek]="true"
[showIcon]="true"
[dateFormat]="primeNGCalendarFormat"
placeholder="dd-mm-jj"
[minDate]="minDate ?? defaultMinDate"
Reproducer
No response
Angular version
17.3.6
PrimeNG version
17.16.0
Build / Runtime
TypeScript
Language
TypeScript
Node version (for AoT issues node --version)
18.12.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Expected: as before, date remains in field and field is invalid (red border)
The text was updated successfully, but these errors were encountered: