From 1e49059fdaff1c6df788a3c1de4a3a204a14e02d Mon Sep 17 00:00:00 2001 From: Henry Liu <645599166@qq.com> Date: Thu, 31 Oct 2024 20:27:28 +0800 Subject: [PATCH] fix(signin button): signin button is clickable when token is autofilled by browser (#9610) * fix(signin button): signin button is clickable when token is autofilled by browser * fix: fix unit test & using input event instead of change event --- modules/web/src/login/component.spec.ts | 2 +- modules/web/src/login/template.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/web/src/login/component.spec.ts b/modules/web/src/login/component.spec.ts index 18045b273ac5..cf8dcc2782f7 100644 --- a/modules/web/src/login/component.spec.ts +++ b/modules/web/src/login/component.spec.ts @@ -153,7 +153,7 @@ describe('LoginComponent', () => { // set inputs and fire change events to trigger onChange() const token = fixture.debugElement.query(By.css(queries.token)).nativeElement; token.value = loginToken; - token.dispatchEvent(new Event('keyup')); + token.dispatchEvent(new Event('input')); submit(); diff --git a/modules/web/src/login/template.html b/modules/web/src/login/template.html index e654897605c4..487df94e11b6 100644 --- a/modules/web/src/login/template.html +++ b/modules/web/src/login/template.html @@ -47,7 +47,7 @@ placeholder="Bearer token" type="password" required - (keyup)="onChange($event)" + (input)="onChange($event)" />