diff --git a/src/app/carto/carto.component.html b/src/app/carto/carto.component.html index 929cb04096bff9ad9d6562dc42e38d8cba1af5ec..b533a278788b7499736afa7901bf11022a4ab32b 100644 --- a/src/app/carto/carto.component.html +++ b/src/app/carto/carto.component.html @@ -1,11 +1,18 @@ <div class="content-container no-pt" [ngClass]="{ orientationHeight: isOrientationForm }"> <h1 class="visually-hidden">Cartographie</h1> <div class="hide-on-print"> - <app-structure-list-search [filters]="filters" (searchEvent)="getStructures($event)" /> + <app-structure-list-search + role="region" + aria-label="Filtres" + [filters]="filters" + (searchEvent)="getStructures($event)" + /> </div> <div class="panes-container"> <app-structure-list class="left-pane" + role="region" + aria-label="Liste des structures" [structureList]="structures" [isLoading]="isLoadingStructures" [selectedStructureList]="structuresSelected" 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 04d8e6e9527a115547a13bdbf5b5f5e5e9709a9d..bd5c4d59d02f33baf366751cd26bc7c45ce68f58 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,12 +1,4 @@ -import { - AfterContentChecked, - AfterViewInit, - ChangeDetectorRef, - Component, - ElementRef, - OnInit, - ViewChild, -} from '@angular/core'; +import { AfterContentChecked, ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { AbstractControl, FormGroup, UntypedFormGroup } from '@angular/forms'; import { Router } from '@angular/router'; import { lastValueFrom } from 'rxjs'; @@ -52,7 +44,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, AfterViewInit { +export class OrientationFormViewComponent implements OnInit, AfterContentChecked { public static readonly MAX_STEP = (Math.max( Object.keys(StructuresListSteps).length, @@ -121,15 +113,6 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked public showConfirmationModal = false; private resolve: CanExitResolver; - @ViewChild('pageTitle') pageTitleElement!: ElementRef; - - ngAfterViewInit(): void { - const mainHeader = document.querySelector('#pageTitle'); - if (mainHeader) { - (mainHeader as HTMLElement)?.focus(); - } - } - constructor( public orientationService: OrientationService, private notificationService: NotificationService, @@ -179,10 +162,10 @@ 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(); - // } + const mainHeader = document.querySelector('#pageTitle'); + if (mainHeader) { + (mainHeader as HTMLElement)?.focus(); + } } public setFailedOrientation(): void {