diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.ts b/src/app/form/orientation-form-view/orientation-form-view.component.ts index bd5c4d59d02f33baf366751cd26bc7c45ce68f58..939508682f06ead7e65e3d65f53333311cbb6faf 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.ts +++ b/src/app/form/orientation-form-view/orientation-form-view.component.ts @@ -162,10 +162,6 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked public validatePage(event: boolean): void { this.isPageValid = event; - const mainHeader = document.querySelector('#pageTitle'); - if (mainHeader) { - (mainHeader as HTMLElement)?.focus(); - } } public setFailedOrientation(): void { @@ -263,6 +259,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked this.updateHiddenNavButtons(); this.updateFullScreen(); this.updateLastStep(); + this.focusOnTop(); } public prevPage(): void { @@ -278,6 +275,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked this.updateHiddenNavButtons(); this.updateFullScreen(); this.updateLastStep(); + this.focusOnTop(); } private goToNextStep(): void { @@ -437,6 +435,13 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked this.filters = []; } + private focusOnTop(): void { + const mainHeader = document.querySelector('#pageTitle'); + if (mainHeader) { + (mainHeader as HTMLElement)?.focus(); + } + } + /** * Indicators */