Calendar validation fails with reactive forms #3436
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/Qi2Nw2imLpDUF8NJinYw?p=preview
Plunker Case = http://plnkr.co/edit/s2vzxz7uCcV7nAQBUrrM?p=preview
Current behavior
I am using a a model-driven form. I type in an invalid date in the Calendar control and then use patchValue / setValue of the FormGroup to programmatically set the value to a predefined known valid state. The UI of the Calendar control correctly updates to display the new valid date, however the Valid property does not update to True and the errors are not cleared from the Calendar form control.
Expected behavior
The valid property should be updated to True and the errors property should be cleared.
Minimal reproduction of the problem with instructions
Type in an invalid date in the Calendar control, e.g. 'adf' and then click the button. The click event of the button resets the value of the form group using patchValue. The Valid status is not updated to True for the Calendar and the errors are not cleared.
http://plnkr.co/edit/s2vzxz7uCcV7nAQBUrrM?p=preview
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Mac OS Sierra Version 10.12.5 using npm package manager,
Issue remains with Angular 4.2.6.
Issue remains with Angular 4.2.6 and PrimeNG 4.1.0
Language: [TypeScript 2.0.3]
Node (for AoT issues):
node --version
= 8.1.4The text was updated successfully, but these errors were encountered: