From 04c2dcfc6b78c7e8714597f9d5370b6b2c87dece Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Jun 2022 14:36:24 +0200 Subject: Fix login form scrolling --- client/src/app/shared/shared-main/angular/autofocus.directive.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/angular/autofocus.directive.ts b/client/src/app/shared/shared-main/angular/autofocus.directive.ts index 2da492ea1..051635f45 100644 --- a/client/src/app/shared/shared-main/angular/autofocus.directive.ts +++ b/client/src/app/shared/shared-main/angular/autofocus.directive.ts @@ -7,6 +7,8 @@ export class AutofocusDirective implements AfterViewInit { constructor (private host: ElementRef) { } ngAfterViewInit () { - this.host.nativeElement.focus() + const el = this.host.nativeElement as HTMLElement + + el.focus({ preventScroll: true }) } } -- cgit v1.2.3