You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case anyone needs a workaround, you can override the isFeatureFlagEnabled method and force the field to behave as if the ENFORCE_FIELD_VALIDATION flag is false.
var field = new EmailField("Email") {
@Override
public boolean isFeatureFlagEnabled(Feature feature) {
if (feature == FeatureFlags.ENFORCE_FIELD_VALIDATION)
return false;
return super.isFeatureFlagEnabled(feature);
}
};
Seems all custom validators do not run until a valid email formatted string is entered. You can see in the GIF posted above that when using enforceFieldValidation the EmailValidator does not trigger.
Seems all custom validators do not run until a valid email formatted string is entered.
Right, it's because Binder first runs the default validator provided by the component. And the email validation is part of the default validator. The problem is that there is currently no way to provide error messages for errors resulting from the default validator. This is why the field appears red without any error message. It's a known problem. Please, refer to #4618 for further updates.
Description of the bug
Vaadin 23.3.19 with
enforceFieldValidation=true
EmailField will be marked as invalid if you enter text and then clear the text. It will only show as valid if you enter an email.
Repro steps:
Expected behavior
Field should be valid if empty.
Minimal reproducible example
var email = new EmailField("Email");
add(email);
Versions
com.vaadin.experimental.enforceFieldValidation=true
The text was updated successfully, but these errors were encountered: