Fixed accessibility issues related to dso selectors

- Fixed header ordering
- Fixed input field not having a description what it does (because the header isn't always shown I decided to use aria-labels instead of regular labels)
This commit is contained in:
Alexandre Vryghem
2023-12-16 00:55:46 +01:00
parent 1c782b2656
commit 2f5370a085
6 changed files with 12 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
<input type="search"
class="form-control"
(click)="$event.stopPropagation();"
[attr.aria-label]="'dso-selector.placeholder' | translate: { type: typesString }"
placeholder="{{'dso-selector.placeholder' | translate: { type: typesString } }}"
[formControl]="input" ngbAutofocus (keyup.enter)="selectSingleResult()">
</div>

View File

@@ -75,6 +75,11 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
*/
@Input() sort: SortOptions;
/**
* The id that should be given to the input box, this is required for accessibility reasons
*/
@Input() searchBoxId: string | null = null;
// list of allowed selectable dsoTypes
typesString: string;

View File

@@ -6,14 +6,14 @@
</div>
<div class="modal-body">
<button class="btn btn-outline-primary btn-lg btn-block" (click)="selectObject(undefined)">{{'dso-selector.create.community.top-level' | translate}}</button>
<h3 class="position-relative py-1 my-3 font-weight-normal">
<div class="h3 position-relative py-1 my-3 font-weight-normal">
<hr>
<div id="create-community-or-separator" class="text-center position-absolute w-100">
<span class="px-4 bg-white">{{'dso-selector.create.community.or-divider' | translate}}</span>
</div>
</h3>
</div>
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
<span class="h5 px-2">{{'dso-selector.create.community.sub-level' | translate}}</span>
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
</div>
</div>

View File

@@ -5,7 +5,7 @@
</button>
</div>
<div class="modal-body">
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
<span *ngIf="header" class="h5 px-2">{{header | translate}}</span>
<ds-authorized-collection-selector [currentDSOId]="dsoRD?.payload.uuid"
[entityType]="entityType"
[types]="selectorTypes"

View File

@@ -5,7 +5,7 @@
</button>
</div>
<div class="modal-body">
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
<span *ngIf="header" class="h5 px-2">{{header | translate}}</span>
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
</div>
</div>

View File

@@ -5,7 +5,7 @@
</button>
</div>
<div class="modal-body">
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
<span *ngIf="header" class="h5 px-2">{{header | translate}}</span>
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
</div>
</div>