IntegerField error message not displaying when field is initially invisible (vaadin 23.3.1)

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.

NumberField error message not displaying when field is initially invisible (vaadin 23.3.1)

IntegerField error message not displaying when field is initially invisible (vaadin 23.3.1)

Could be related to https://github.com/vaadin/web-components/issues/5138 but I’m not sure

i don’t think it is related to that. My issue is really about the non displaying of the error message due to the lack of the ‘invalid’ attribute on the field element. It does have the error or warning theme. Also the fact that that $0.invalid = … hack fixes the issue at hand tells me that the fix of https://github.com/vaadin/vaadin-text-field-flow/pull/204/files is forgotten on all other input type fields…

If you think so, a proper ticket in the flow-components repo would help to get this investigated

I discovered the error only exists when using a setMin, setMax or setStep… I assume you’re not supposed to use those in conjunction with a validator?

Well currently the binder / validation overrides thoses - so yeah, either remove your validations or add those checks also to the validations

yeah. but the unfortunate thing is that even the min, max and step violation errors are not displayed.