Angular 2 - Form is invalid when browser autofill

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

    I seem to have solved this by just simulating a click on the page AfterViewInit.

    public ngAfterViewInit(): void {
        $('body').click();
    }
    

    Chrome 67.0.3396.99, Angular 5.1.0

提交回复
热议问题