Skip to content

Commit 910adf5

Browse files
authored
feat(drop-down-item): add aria-label setter (#12131)
* feat(drop-down-item): add aria-label setter * chore(*): Update Changelog
1 parent 28a5e62 commit 910adf5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4+
## 14.2.0
5+
6+
- `IgxDropDown`
7+
- The `aria-label` attribute of the `IgxDropDownItemBase` can now be se to a custom value for its descendants (of which `IgxDropDownItem`) by the `ariaLabel` property.
48

59
## 14.1.0
610

projects/igniteui-angular/src/lib/drop-down/drop-down-item.base.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export class IgxDropDownItemBaseDirective implements DoCheck {
3434
@HostBinding('attr.aria-label')
3535
@Input()
3636
public get ariaLabel(): string {
37-
return this.value ? this.value : this.id;
37+
return this._label ? this._label : this.value ? this.value : this.id;
38+
}
39+
40+
public set ariaLabel(value: string) {
41+
this._label = value;
3842
}
3943

4044
/**
@@ -282,6 +286,7 @@ export class IgxDropDownItemBaseDirective implements DoCheck {
282286
protected _selected = false;
283287
protected _index = null;
284288
protected _disabled = false;
289+
protected _label = null;
285290

286291
constructor(
287292
@Inject(IGX_DROPDOWN_BASE) protected dropDown: IDropDownBase,

0 commit comments

Comments
 (0)