Angular 2 - Form is invalid when browser autofill

前端 未结 7 1916
广开言路
广开言路 2021-01-31 16:48

I have a Login Form which has email and password fields.

I\'ve chosen for browser autofill.

The problems is: When browser autofills login form, both fields are p

7条回答
  •  梦如初夏
    2021-01-31 17:23

    According to the offical docs

    "pristine" means the user hasn't changed the value since it was displayed in this form
    

    So if you have a validation in your form it's a better approach to check if the form is "valid" or "invalid"

    
    

    So it doesn't matter if the form is pristine or not.

提交回复
热议问题