-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix: disable client side validation #973
fix: disable client side validation #973
Conversation
...t/vaadin-select-flow/src/main/java/com/vaadin/flow/component/select/FieldValidationUtil.java
Show resolved
Hide resolved
...ect-flow/src/main/java/com/vaadin/flow/component/select/generated/GeneratedVaadinSelect.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions:
- Test detaching and reattaching the select element and see if everything still works as expected
- Test a select on a Grid
...ct-flow-parent/vaadin-select-flow/src/main/java/com/vaadin/flow/component/select/Select.java
Show resolved
Hide resolved
vaadin-select-flow-parent/vaadin-select-flow-integration-tests/pom.xml
Outdated
Show resolved
Hide resolved
Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com>
1d88aa6
to
2b13b9d
Compare
SonarQube analysis reported 16 issues Top 10 issues
|
* fix: disable client validation * Simplify override client validation IT * Simplify override client validation IT * Extract FieldValidationUtil * Ensure correct inital client-side value * Fix formatting * Add test for detach/reattach scenario * Add test for select in grid usage * Use project version variable for Maven dependency Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com>
Hi @sissbruecker , this commit cannot be picked to 19.0 by this bot, can you take a look and pick it manually? |
Hi @sissbruecker , this commit cannot be picked to 14.7 by this bot, can you take a look and pick it manually? |
Hi @sissbruecker , this commit cannot be picked to 14.6 by this bot, can you take a look and pick it manually? |
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
Fixes: vaadin/vaadin-select#265 Warranty: Fixes client-side select overriding validation state from server Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> (cherry picked from commit 14676de)
* fix: disable client validation * Simplify override client validation IT * Simplify override client validation IT * Extract FieldValidationUtil * Ensure correct inital client-side value * Fix formatting * Add test for detach/reattach scenario * Add test for select in grid usage * Use project version variable for Maven dependency Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com> Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com>
Description
The original issue occurs because the select web component triggers its own client-side validation in several places (specifically to the issue, when the dropdown is closed), which then overwrites the validation state set by the server. Investigating this also lead to another issue that changing the validation state on the client through JS / dev tools also changed the validation state on the server, which should not be allowed.
This change fixes that by:
null
which initially lead the client side component to pass validation, because the value was not emptyFixes vaadin/vaadin-select#265
Type of change