Skip to content

Commit 921726c

Browse files
committed
feat(suggest): add input for aria-label
1 parent 1d4b903 commit 921726c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

projects/angular/components/ui-suggest/src/ui-suggest.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
[uiAutofocus]="!isOpen && focus"
2222
[refocus]="!isOpen && focus"
2323
[matRippleDisabled]="isFormControl"
24-
[attr.aria-label]="placeholder"
24+
[attr.aria-label]="ariaLabel ?? placeholder"
2525
[attr.aria-describedby]="describedBy"
2626
[attr.aria-required]="required"
2727
[attr.aria-disabled]="disabled || readonly"
@@ -80,7 +80,7 @@
8080
<ng-template #chipsTemplate>
8181
<mat-chip-list #chipList
8282
[attr.tabindex]="!disabled && !readonly ? 0 : null"
83-
[attr.aria-label]="placeholder"
83+
[attr.aria-label]="ariaLabel ?? placeholder"
8484
[attr.aria-describedby]="describedBy"
8585
[attr.aria-required]="required"
8686
[attr.aria-disabled]="disabled || readonly"
@@ -130,7 +130,7 @@
130130
[formControl]="inputControl"
131131
[matChipInputFor]="chipList"
132132
[attr.maxlength]="maxLength"
133-
[attr.aria-label]="placeholder"
133+
[attr.aria-label]="ariaLabel ?? placeholder"
134134
selectionLocation="end"
135135
autocomplete="off"
136136
aria-autocomplete="list"

projects/angular/components/ui-suggest/src/ui-suggest.mat-form-field.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ export abstract class UiSuggestMatFormFieldDirective implements
110110
@Input()
111111
shouldHideTitle = false;
112112

113+
/**
114+
* Sets aria-label on input or mat-chip-list element.
115+
*
116+
*/
117+
@Input('aria-label')
118+
ariaLabel: string | null = null;
119+
113120
/**
114121
* Set a custom size for the list items.
115122
*

0 commit comments

Comments
 (0)