Some DatePicker functions are not working as I expect.
picker.clear()
→ is not clearing the field - the manually malformed user input persists. I tried:
picker.setValue(null)
, and picker.setValue(picker.getEmptyValue())
, but all leave the input data present.
How can we read a String that’s been input by the user? If the input doesn’t result in a valid LocalDate, then picker.getValue()
returns null. So how do we distinguish between a field that the user made empty (which is OK) and a field that the user typed 2020-07-aa, which we may want to clear out?
It would be nice to prevent the user from entering text at all, forcing all inputs to use the provided calendar. There [was some discussion]
(https://github.com/vaadin/vaadin-date-picker/issues/550) about this previously so I’d like to add my +1 that this would be a nice feature to avoid keyboard inputs - similar to Vaadin 8 ComboBox comboBox.setTextInputAllowed(false);