-
Notifications
You must be signed in to change notification settings - Fork 66
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
Vaadin 23.3.6 | DatePicker does not provide entered value as intended #4697
Comments
You should use Binder and enable enforceFieldValidation=true in feature flags in src/main/resources/vaadin-featureflags.properties file. com.vaadin.experimental.enforceFieldValidation=true That is a new feature we have developed exactly for this kind of use. I.e. to detect input of wrong format in DatePicker or some other fields. Also it is possible to use DatePicker#addClientValidatedEventListener to detect changes when not using Binder. |
The question is actually about race condition when using key shortcuts. Here is a more simplified example of the case, which has been solved by using empty JavaScript call to post pone activity to the next roundtrip. This way get correct value.
|
Description
We are setting up a Vaadin Renderer for our business applications and are struggling with DatePicker currently.
When starting with empty DatePicker Fields, the user can enter a new value on the fly - let's say "17.02.2023".
Now the user has many options that need us to get the entered value.
In all those cases, he did not "finish" his input by typing ENTER, which would cause DatePicker to update its internal value.
Let's take STRG + S as an example:
When our save code runs, it needs current user input in the date field. But there is no way to get it, as DatePicker provides old null value.
We reached out to the Vaadin Chat and got first workaround idea, wich is not suitable for us, but makes this issue reproducable.
Expected outcome
We would expect, that we can access valid user input somehow when pressing STRG+S and our save code runs. If user input is not valid, we should be able to recognize this as well in order to abort saving process. As DatePicker has not processed the user input in our use case, we are stuck.
Minimal reproducible example
Steps to reproduce
Environment
Vaadin Version 23.3.6
OS Linux and Windows
Browsers
Chrome, Firefox, Safari on iOS
The text was updated successfully, but these errors were encountered: