primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.45k stars 4.6k forks source link

Calendar: Properties `[minDate]` or `[maxDate]` require the date to be clicked at least twice to be selected in reactive forms #15391

Open ThoSap opened 6 months ago

ThoSap commented 6 months ago

Describe the bug

When the PrimeNG Calendar is used with Angular reactive forms, setting the input bindings [minDate] [maxDate] require the date to be clicked at least twice to be selected in reactive forms.

Environment

StackBlitz - PrimeNG CalendarReactiveFormsDemo min/max Date requiring at least two clicks

Reproducer

https://stackblitz.com/edit/admo19?file=src%2Fapp%2Fdemo%2Fcalendar-reactive-forms-demo.ts,src%2Fapp%2Fdemo%2Fcalendar-reactive-forms-demo.html

Angular version

17.3.6 and 17.3.1 (from StackBlitz)

PrimeNG version

17.15.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v20.11.1

Browser(s)

Microsoft Edge 124.0.2478.67

Steps to reproduce the behavior

StackBlitz - PrimeNG CalendarReactiveFormsDemo min/max Date requiring at least two clicks

Expected behavior

Only one click should be needed to select a date in the PrimeNG Calendar if the input bindings [minDate] or [maxDate] are set together with reactive forms.

ThoSap commented 6 months ago

Could be related to https://github.com/primefaces/primeng/issues/15140 but there the [formControlName] was passed wrong.

ThoSap commented 2 months ago

@cetincakiroglu this is still an issue with PrimeNG v17.18.9