From b601405e564bf6c668a3cd6086c6c9d9a56eb2f8 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Fri, 27 Sep 2024 13:44:31 -0300 Subject: [PATCH 1/4] Adding the aria-label attribute to buttons --- .../vocabulary-treeview.component.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html index a0d320a8544..a37b26e3482 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html @@ -6,13 +6,16 @@ [attr.aria-label]="'vocabulary-treeview.search.form.search-placeholder' | translate" [placeholder]="'vocabulary-treeview.search.form.search-placeholder' | translate">
- - -
@@ -88,13 +91,15 @@

- - From 14680b013e5c7ced5d4243806a7d7a027111620d Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Fri, 27 Sep 2024 14:01:44 -0300 Subject: [PATCH 2/4] Adding focus to the input after the reset button is clicked --- .../vocabulary-treeview.component.html | 2 +- .../vocabulary-treeview/vocabulary-treeview.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html index a37b26e3482..a216384c9c5 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html @@ -2,7 +2,7 @@
-
diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index b1edda461e5..2602cfd75e0 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -1,5 +1,5 @@ import { FlatTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges, ViewChild } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { Store } from '@ngrx/store'; @@ -29,6 +29,11 @@ import { AlertType } from '../../alert/alert-type'; }) export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges { + /** + * Implemented to manage focus on input + */ + @ViewChild('searchInput') searchInput: ElementRef; + /** * The {@link VocabularyOptions} object */ @@ -294,6 +299,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges this.storedNodeMap = new Map(); this.vocabularyTreeviewService.restoreNodes(); } + this.searchInput.nativeElement.focus(); } add() { From 75260b00d95d6bf3024a9387127ebab65e64b368 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Fri, 27 Sep 2024 15:08:53 -0300 Subject: [PATCH 3/4] =?UTF-8?q?Ensuring=20that=20the=20message=20=E2=80=9C?= =?UTF-8?q?There=20were=20no=20items=20to=20show=E2=80=9D=20is=20announced?= =?UTF-8?q?=20to=20the=20screen=20reader=20when=20necessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vocabulary-treeview.component.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html index a216384c9c5..ad894328a61 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html @@ -24,9 +24,11 @@
-

- {{'vocabulary-treeview.search.no-result' | translate}} -

+
+

+ {{'vocabulary-treeview.search.no-result' | translate}} +

+
From a8ff6a41e051cb68c6083da2df588888d37e2903 Mon Sep 17 00:00:00 2001 From: andreaNeki Date: Fri, 27 Sep 2024 16:18:56 -0300 Subject: [PATCH 4/4] Trying to correct an error in the focus implementation --- .../vocabulary-treeview/vocabulary-treeview.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index 2602cfd75e0..56956440406 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -32,7 +32,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges /** * Implemented to manage focus on input */ - @ViewChild('searchInput') searchInput: ElementRef; + @ViewChild('searchInput') searchInput!: ElementRef; /** * The {@link VocabularyOptions} object @@ -299,7 +299,9 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges this.storedNodeMap = new Map(); this.vocabularyTreeviewService.restoreNodes(); } - this.searchInput.nativeElement.focus(); + if (this.searchInput) { + this.searchInput.nativeElement.focus(); + } } add() {