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
The recently introduced validated event has revealed that there is an initial validation that happens when the field has an initial value and is initially marked as invalid:
consttextField=document.createElement('vaadin-text-field');textField.value='Initial Value';textField.invalid=true;textField.addEventListener('validated',()=>{console.warn('The text field was validated!');// You'll see this warning.});document.appendChild(textField);
The initial validation is problematic because it may result in an invalid state reset on the Flow side, see vaadin/flow-components#3429 (comment) for a more detailed case.
Motivation
The recently introduced
validated
event has revealed that there is an initial validation that happens when the field has an initial value and is initially marked as invalid:The initial validation is problematic because it may result in an invalid state reset on the Flow side, see vaadin/flow-components#3429 (comment) for a more detailed case.
A follow-up to #4081.
Part of vaadin/platform#3066
Solution
Ensure no initial validation when the field has an initial value and invalid. The validation should only happen on some interaction with the field.
Components
The text was updated successfully, but these errors were encountered: