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 validation fails with reactive forms #3436

Closed
dcs3spp opened this issue Jul 18, 2017 · 2 comments
Closed

Calendar validation fails with reactive forms #3436

dcs3spp opened this issue Jul 18, 2017 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@dcs3spp
Copy link

dcs3spp commented Jul 18, 2017

I'm submitting a ... (check one with "x")

[ x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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,

  • Angular version: 4.2.6

Issue remains with Angular 4.2.6.

  • PrimeNG version: 4.1.0

Issue remains with Angular 4.2.6 and PrimeNG 4.1.0

  • Browser: [all ]
  • Language: [TypeScript 2.0.3]

  • Node (for AoT issues): node --version = 8.1.4

@tokuduzcc
Copy link

tokuduzcc commented Aug 22, 2017

Hi,
We got the same issue. Did you maybe find a workaround?

TK

@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Aug 23, 2017
@cagataycivici cagataycivici added this to the 4.2 milestone Aug 23, 2017
@cagataycivici
Copy link
Member

Calendar clears the manual input if it is invalid so I wonder if do we still need the built-in invalidDate validation. It makes this very confusing so I'll remove it.

@cagataycivici cagataycivici self-assigned this Sep 12, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Sep 12, 2017
@cagataycivici cagataycivici changed the title Updating a Calendar control that is in an invalid state (using setValue / patchValue) does not update Valid property to true. The Errors property is also not cleared. Calendar validation fails with reactive forms Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants