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

Determining when to show meaningful errors #44

Closed
jolexxa opened this issue Oct 18, 2021 · 0 comments · Fixed by #48
Closed

Determining when to show meaningful errors #44

jolexxa opened this issue Oct 18, 2021 · 0 comments · Fixed by #48
Assignees
Labels
feature A new feature or request

Comments

@jolexxa
Copy link

jolexxa commented Oct 18, 2021

Currently, the error property on pure, invalid instances of FormzInput is non-null, indicating what the validation error was. Perhaps Formz could expose an additional getter for UI purposes to indicate that the validation error, while correct, is typically ignored for pure forms from a UI perspective. Ignoring validation errors on unmodified (pure) fields typically creates a more pleasant UI experience, and a mechanism like this might better facilitate that.

abstract class FormzInput<T, E> {
  E? get displayError = pure ? null : error;
  E? get error => validator(value);
  ...

Other approaches could also solve the same problem, I'm sure.

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

Successfully merging a pull request may close this issue.

2 participants