-
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
asRequired method with Binder does not work properly with the tab button #1232
Comments
My guess is that this is related to the logic that avoids eagerly showing validation errors for untouched fields. This logic is in place to avoid situations where a newly opened (empty) form form would look scary by being full of validation error indicators. Most likely, the server-side validation logic doesn't get out of this mode for the field until a value has been submitted to the server, which might not happen if you type something in there and remove it again before tabbing out. From the server's point of view, this is the same situation as if you'd just tab through the fields without making any changes to them. |
When I use this line of code it works properly: |
The basic difference between the web component and Flow is that the web component runs validation on This causes differences in the behavior depending on the |
Yeah, that validates my hypothesis. The question is still whether it's desirable from a UX perspective that an initially empty field would show up as invalid after you've tabbed through it but not made any changes (or made changes that have been reverted "immediately"). |
This is how our web components work, and I'd assume the UX has been designed thoroughly during their implementation. |
Yes, tabbing through a field has been considered “enough” to trigger the validation. |
The issue has been resolved by the new validation mechanism which is enabled by default in Vaadin 24. For any further bugs, please create new issues. |
When I use the code below and I use the tab button only to tab between components, the
asRequired
method in binding does not work properly.First Demo:
Second Demo:
In the FirstDemo.gif when you click on the name field and enter a data and you delete it and you use your tab to go to another component the requirement is not checked.
In the secondDemo.gif when you click on the name field and enter some data and use your mouse to click somewhere out of that text-field area and then select the data and delete it the requirement validation will work.
The text was updated successfully, but these errors were encountered: