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

Primeng calendar won't show the correct value in the field #16378

Open
2-Dpot opened this issue Sep 12, 2024 · 1 comment
Open

Primeng calendar won't show the correct value in the field #16378

2-Dpot opened this issue Sep 12, 2024 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@2-Dpot
Copy link

2-Dpot commented Sep 12, 2024

Describe the bug

The behaviour is sporadic.
When passed a value to ngModel the value doesn't reflect in the input field. Instead we have to manually open the calendar and select the value

Environment

Behaviour is sporadic in nature.
It works in local development mode but in production build the issue is visible

Reproducer

No response

Angular version

^17.3.4

PrimeNG version

17.18.9

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.19.1

Browser(s)

Chrome 128.0.6613.138

Steps to reproduce the behavior

On click of a button just keep passing random values to the primeng calendar , it fails with a blank field

Expected behavior

The value that is passed to the ngModel of the calendar should be reflected on the field

@2-Dpot 2-Dpot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 12, 2024
@yjolivet
Copy link

yjolivet commented Oct 10, 2024

Hello,

I don't know if it will help you to fix your problem but I think I faced the same problem.

For me the problem was that I putted a [minDate] attribute to the calendar. The calendar value was managed by a FormControl.
When I would like to update the [minDate] value and the FormControl value I faced the problem.
If I tried to change the FormControl value with a value less than the previous [minDate] value then the calendar showed a blank field. After if I clicked on the calendar field the value showed.

To fix it I removed manually the [minDate] value on the calendar with a @ViewChild reference to the component. I set the new [minDate] value after my FormControl update.

Maybe it could help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants