It seems i’m running in to the same issue as https://github.com/vaadin/vaadin-text-field-flow/pull/204/files / https://github.com/vaadin/flow/issues/5875 but for an IntegerField.
The field is initially invisible and invalid due to a custom validator ( binder withValidator) in my form. When the field becomes visible later (triggered by a value change by the user of an other field), then the validation error message is hidden. The tag in the browser lacks the invalid attribute.
I discovered that applying the same fix as in the PR above it works for me. I wrapped my custom validator method with this:
protected ValidationResult validateMyIntegerField(Integer value, ValueContext context) {
ValidationResult result = doValidateMyIntegerField(value, context);
myIntegerField.getUI().ifPresent(ui -> ui.getPage().executeJs("$0.invalid = " + (result != null && result.getErrorLevel().orElse(null) != null), myIntegerField.getElement()));
return result;
}
Can you confirm that this https://github.com/vaadin/vaadin-text-field-flow/pull/204 fix is missing on non textfields?
This issue was not present in Vaadin 14. I experience it now during my upgrade to 23.3.1.