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

Validate on constraint property changes if the field has a value #4371

Closed
vursen opened this issue Aug 19, 2022 · 0 comments
Closed

Validate on constraint property changes if the field has a value #4371

vursen opened this issue Aug 19, 2022 · 0 comments
Assignees

Comments

@vursen
Copy link
Contributor

vursen commented Aug 19, 2022

As illustrated in #4196, field components don't trigger validation consistently on constraint property change.

Let's align their behavior in the following way:

  • Trigger validation on constraint property changes if the field has a value (because the value can possibly be invalidated by the new constraints configuration)
  • Trigger validation during initialization if at least one constraint is defined and the field has a value (providing an initial value that doesn't match constraints sounds more like an edge case and rather an app business logic error, but if this has happened by any chance, it is better to provide immediate feedback for the user to be able to correct the value)

A related ticket for Flow components: vaadin/flow-components#2370

@vursen vursen changed the title Always trigger validation on constraint properties' change Always trigger validation on constraint property changes Aug 19, 2022
@vursen vursen changed the title Always trigger validation on constraint property changes trigger validation on constraint property changes if the field has a value Aug 19, 2022
@vursen vursen changed the title trigger validation on constraint property changes if the field has a value Validate on constraint property changes if the field has a value Aug 19, 2022
@vursen vursen self-assigned this Aug 23, 2022
@vursen vursen closed this as completed Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants