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

input validation errors must disappear when resolved #5699

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

isimluk
Copy link

@isimluk isimluk commented Jan 17, 2024

I came across an interesting a corner case.

Validation errors for an input field would never disappear, even after user amends their input to be valid. I noticed that heex template would be re-rendered on the server (input() method was called), but UI would never remove the last errors from the view.

Getting rid of defaults: [] fixed this. It seems this is safe to do as errors are always assigned with

    |> assign(:errors, Enum.map(field.errors, &translate_error(&1)))

Critical look at this pr is advised as I am newbie here.

Thank You for your work on this amazing work, I enjoyed myself exploring it during the last 14 days.

I came across an interesting a corner case.

Validation errors for an input field would never disappear, even after user amends their input to be valid. I noticed that heex template would be re-rendered on the server (`input()` method was called), but UI would never remove the last errors from the view.
   
Getting rid of `defaults: []` fixed this. It seems this is safe to do as errors are always assigned with 

```
    |> assign(:errors, Enum.map(field.errors, &translate_error(&1)))
````
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

Successfully merging this pull request may close these issues.

None yet

1 participant