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

Commits on Jan 17, 2024

  1. input validation errors must disappear when resolved

    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)))
    ````
    isimluk committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    57d709a View commit details
    Browse the repository at this point in the history