Fix login form scrolling
This commit is contained in:
parent
1105696623
commit
04c2dcfc6b
|
@ -67,7 +67,7 @@ export class ScrollService {
|
||||||
private consumeScroll () {
|
private consumeScroll () {
|
||||||
// Handle anchors/restore position
|
// Handle anchors/restore position
|
||||||
this.peertubeRouter.getScrollEvents().subscribe(e => {
|
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
|
// scrollToAnchor first to preserve anchor position when using history navigation
|
||||||
if (e.anchor) {
|
if (e.anchor) {
|
||||||
|
|
|
@ -7,6 +7,8 @@ export class AutofocusDirective implements AfterViewInit {
|
||||||
constructor (private host: ElementRef) { }
|
constructor (private host: ElementRef) { }
|
||||||
|
|
||||||
ngAfterViewInit () {
|
ngAfterViewInit () {
|
||||||
this.host.nativeElement.focus()
|
const el = this.host.nativeElement as HTMLElement
|
||||||
|
|
||||||
|
el.focus({ preventScroll: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue