Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix login form scrolling

Chocobozzz04c2dcfc6b78
diff --git a/client/src/app/core/routing/scroll.service.ts b/client/src/app/core/routing/scroll.service.ts
index bd50765024..6d37fde71c 100644
--- a/client/src/app/core/routing/scroll.service.ts
+++ b/client/src/app/core/routing/scroll.service.ts
@@ -67,7 +67,7 @@ export class ScrollService {
private consumeScroll () {
// Handle anchors/restore position
this.peertubeRouter.getScrollEvents().subscribe(e => {
- logger('Will schedule scroll after router event %o.', e)
+ logger('Will schedule scroll after router event %o.', { e, resetScroll: this.resetScroll })
// scrollToAnchor first to preserve anchor position when using history navigation
if (e.anchor) {
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 2da492ea11..051635f457 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 })
}
}