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

ClrForm : reset a form let error in controls directives #1398

Open
Rebolon opened this issue May 23, 2024 · 0 comments
Open

ClrForm : reset a form let error in controls directives #1398

Rebolon opened this issue May 23, 2024 · 0 comments

Comments

@Rebolon
Copy link

Rebolon commented May 23, 2024

This is a bug report for the @clr Angular or UI versions of the design system.
For the web-component implementation of Clarity (@cds), visit vmware-clarity/core.

If you are a VMware employee or a contractor in VMware, please use our support space in Google Chat to raise Clarity issues.

Describe the bug

Using an angular reactive form with directive clrForm & clrInput, when we reset this form, existing errors are still displayed whereas Angular reactive form instance has no more errors.

How to reproduce

  • Sample on Stackblitz
  • There is a simple form with an input.
  • click inside the input button and then outside the input
  • you must see Errors (red icon and red text)
  • click on reset Button
  • errors are still here
  • fill a string in the input
  • click on Submit
  • errors are still here

I also added a Validate and destruct button that does like the validate, but also replace the form property by a new instance (the only acceptable and easyly maintainable solution for me, until a fix is available).

Expected behavior

When we click on a reset button or when we do it programmatically (myForm.reset()), then the form and all its controls should be pristine, and errors must be removed.

Versions

Clarity version:

All clarity version (bug already exists 5 years ago : https://stackoverflow.com/questions/52459708/how-to-reset-error-state-of-clarity-forms/78523030#78523030) and still exists with versions 16 and 17

Framework version:

Angular 15, 16, 17 (and certainly all previous)

Device:

  • Type: Lenovo
  • OS: Ubuntu
  • Browser Chrome
  • Version 124

Additional notes

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant