Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar component: date input value is removed when a date before mindDate is entered #15487

Closed
rolsmam opened this issue May 7, 2024 · 2 comments · Fixed by #15489 · May be fixed by Rodolphe33/gestion-prospects#2 or diaz-rigo/austins#4
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@rolsmam
Copy link

rolsmam commented May 7, 2024

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:

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

  1. Set minDate
  2. Set keepinvalid true
  3. Input date before mindate
  4. Actual result: date is removed, field not invalid

Expected behavior

Expected: as before, date remains in field and field is invalid (red border)

@rolsmam rolsmam added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 7, 2024
@RogueTea
Copy link
Contributor

RogueTea commented May 7, 2024

Ah, I believe I actually introduced this bug. Working on it now.

@gvlekke
Copy link

gvlekke commented May 7, 2024

Thanks for your quick response and if you need any help @RogueTea don't hesitate to ask :)

@cetincakiroglu cetincakiroglu added this to the 17.16.1 milestone May 8, 2024
@cetincakiroglu cetincakiroglu added LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
4 participants