diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.html b/src/app/form/orientation-form-view/orientation-form-view.component.html index 3f3cec3f8414921ebad3fb95e7d87f8abc984666..8418ec94a496f6b2411f90ac5c0d93b6e6a3bd52 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.html +++ b/src/app/form/orientation-form-view/orientation-form-view.component.html @@ -1,5 +1,6 @@ <div class="orientation" aria-live="polite" cdkTrapFocus [cdkTrapFocusAutoCapture]="true"> - <h1 class="visually-hidden">Orientation</h1> + <h1 class="sr-only" id="pageTitle" tabindex="-1">Orientation</h1> + <div *ngIf="!isLogged" class="notConnected"> <img src="../../assets/form/profileSkip.svg" alt="" /> <div class="count"> 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 088de86e0748ffdf0dfd71ad5463c7a8bbe43a47..a7d3c17e72913291b0911130ba9f8fc358b5e3a2 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 @@ -1,4 +1,12 @@ -import { AfterContentChecked, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { + AfterContentChecked, + AfterViewInit, + ChangeDetectorRef, + Component, + ElementRef, + OnInit, + ViewChild, +} from '@angular/core'; import { AbstractControl, FormGroup, UntypedFormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { lastValueFrom } from 'rxjs'; @@ -44,7 +52,7 @@ import { AllOrientationSteps } from './types/orientation.types'; templateUrl: './orientation-form-view.component.html', styleUrls: ['./orientation-form-view.component.scss'], }) -export class OrientationFormViewComponent implements OnInit, AfterContentChecked { +export class OrientationFormViewComponent implements OnInit, AfterContentChecked, AfterViewInit { public static readonly MAX_STEP = (Math.max( Object.keys(StructuresListSteps).length, @@ -113,6 +121,15 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked public showConfirmationModal = false; private resolve: CanExitResolver; + @ViewChild('pageTitle') pageTitleElement!: ElementRef; + + ngAfterViewInit(): void { + // Un petit délai peut aider à s'assurer que le rendu est terminé + setTimeout(() => { + this.pageTitleElement.nativeElement.focus(); + }, 100); + } + constructor( public orientationService: OrientationService, private notificationService: NotificationService,