DatePicker field with BeanValidationBinder on @NotNull bean property is ini

Environment

Windows 10, localization PL-pl, Java 8, Firefox or Chrome

Description

For:

  1. Vaadin DatePicker field with BeanValidationBinder on @NotNull bean property
  2. No readBean() and no validate() being initialy called
  3. No data being initialy entered to the field

In v. 14.0.5 the field was initialy rendered ok (as a normal valid required field).
From Vaadin v 14.0.6 the DatePicker field is initialy rendered by flow as an invalid field (red) with no required attribute. It should be mentioned that in the same time the NumberField on similar @NotNull bean property is initialy rendered ok as a valid required field.
I think it’s a bug in DatePicker.

Expected outcome

Initialy when no data was entered the DatePicker field should be rendered as a normal valid and required field, just like others fields, eg. NumberField on similar @NotNull bean property.

Actual outcome

From Vaadin v 14.0.6 the DatePicker field is initialy rendered with invalid attribute and with no required indicator (no required attribute).

Steps to reproduce

  1. Get Vaadin Starter Project (Spring Boot).
  2. Add simple binder form in MainView:
Binder<AData> binder = new BeanValidationBinder<>(AData.class);

NumberField numberField = new NumberField("Number");
binder.bind(numberField, "number");
add(numberField);

DatePicker dateField = new DatePicker("Date");
binder.bind(dateField, "date");
add(dateField);
  1. For simple bean:
public class AData {
	@NotNull
	private Integer number;

	@NotNull
	private LocalDate date;

	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	public LocalDate getDate() {
		return date;
	}
	public void setDate(LocalDate date) {
		this.date = date;
	}
}
  1. Run in new 14.0.8 and then the same on 14.0.5.

Question

Is this a bug (why on v. 14.0.5 everything was ok)?
Does anyone have a similar problem and know how to deal with it?
Any help is appreciated :slight_smile:

I’d recommend filing a bug in GitHub: https://github.com/vaadin/vaadin-date-picker-flow/issues

Thank You Olli.

I’ve created an issue: https://github.com/vaadin/vaadin-date-picker-flow/issues/203