Angular 2 - Form is invalid when browser autofill

前端 未结 7 2062
广开言路
广开言路 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:32

    I solved it by also checking if the form was touched when displaying error messages. So, for example, the submit button looks like this

    
    

提交回复
热议问题