-
Notifications
You must be signed in to change notification settings - Fork 169
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
Do not clear error message when the field becomes valid #3439
Comments
I think we can trust that, as @jouni stated that is how it works for Vaadin Elements and I tested also The javadocs for |
Yeah, I think we can make a design decision, that we treat error messages the same as tooltips, that they are only shown to the user when needed, not always. I agree that this is might not be completely obvious to all users. But it’s easy to argue, that there shouldn’t be a need to show an error message if a field is valid. A “description” or “hint text” is also similar, that it could be shown only when the field is not invalid and it is replaced with the error message when the field is invalid. |
* Don't remove error message when the field becomes valid Fix for #3439
As a result the assumption is wrong for TextField e.g. I will create a ticket against Flow but as I understand this is the issue in https://github.com/vaadin/vaadin-text-field-flow/issues/56 |
@jouni commented on Tue Oct 24 2017
When the field becomes valid, the error message is cleared and removed from the DOM. This can cause issues with themes that expect the error message to remain in the DOM, for the purpose of transitions/animations.
The
vaadin-text-field
element hides the error message automatically when the field is valid, so there shouldn’t be a need to remove the text content of the message:https://github.com/vaadin/vaadin-text-field/blob/master/vaadin-text-field.html#L130
Here’s the unwanted behavior - the error message vanishes too quickly:
Here’s the desired behavior – the error message is nicely curtained/collapsed:
This could also be a Vaadin Flow Binder issue, so feel free to move it to a more appropriate repo if needed.
@denis-anisimov commented on Tue Jan 30 2018
That's the Flow binder issue definitely.
There is a code that clears the error message when the field should become valid.
The problem here is that it's the common behavior: binder doesn't distinguish text field or any other component.
It executes the logic for any
HasValidation
component.As a result there is the question: is it true that it's enough to update only the status without the error message for any component which allows to set error message and "valid/invalid" status ?
The text was updated successfully, but these errors were encountered: