-
Notifications
You must be signed in to change notification settings - Fork 86
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
User does not get feedback when a value is matched asynchronously on the server #942
Comments
Actually, I’m not sure if the invalid state can be considered as a breaking change? The underlying, programmatic value would still be the same (previous valid value, null/empty in the example above). Only the presentation would change. That said, I don’t know how that would work with all sorts of validation logic. |
Off the top of my head, I don't think anything shoud happen -- maybe the user just noticed that it's still loading, and wants to refocus the field to be able to pick an item from the list once it's done loading?
If the loading really takes that much time, which I certainly hope it very rarely would do, then maybe clearing the filter value would suffice as a way to cancel it? As for the question of whether the invalid state is a breaking change, from the users point of view, I'd say no -- the current behavior could even be described as buggy or at least unexpected. From a validation logic POV, I can't say, hoping others can give their opinion. |
Imagine a scenario:
Do we still clear the field, or do we keep the input, as the user might want to continue writing from what was in the input previous? |
Even if validation logic would get caught up on this, I would still think it would be an okay change. The user would just be made more aware that what they were trying to select wasn’t actually a thing, and they should go back and check it (instead of letting them believe all is fine, we just dismissed what you wrote). The change would not affect “happy paths”, where the selection goes through correctly. I would not think the change would break any user’s workflow. |
Definitely keep the input if you ask me. The way I see it, the state (filter text, validity) of the field should not be affected by whether or not it's focused or not. |
If a combo box uses a lazy loading data provider, any value the user enters into the field needs to be matched to the entire set of options in the data set.
As demonstrated in vaadin/vaadin-combo-box#919, it is possible that the value the user types into the field gets discarded after they have already moved onto filling other fields. It is possible that the user does not notice this, and a value they entered ends up getting ignored.
Currently, if a the typed value does not match any items in the data set, the field value is cleared.
A better option, possibly, would be to mark the field as invalid and retain the value the user typed. The underlying value would be the previous valid value, but the displayed value would be what the user typed. This is how date picker currently works.
Changing this behavior would be considered a breaking change, and requires a new major version. To alleviate the issue before a new major version, we should consider using some other feedback mechanism to let the user know what is happening.
One option is to show a loading spinner in the field while the component checks from the data provider if there is a matching item to set as the value. The user would notice the spinner, and hopefully also then notice if the field gets cleared after the server request finishes (either confirming a matching value or clearing the field).
If we choose to add a spinner in the field (while hiding the toggle button), we could deprecate and hide the spinner in the overlay. This assumes that it would be okay to show the spinner also when the popup is already opened and the user scrolls the list to load more items.
Updated loading state behavior
Preferred behavior (breaking change)
(Figma source)
This would be considered as a fix to vaadin/vaadin-combo-box#919
Open questions:
The text was updated successfully, but these errors were encountered: