Skip to content

Commit 8b6bcec

Browse files
authored
Merge branch '9.1.x' into ddincheva/monthPickerAnimation-9.1
2 parents 0873e10 + ec77289 commit 8b6bcec

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes for each version of this project will be documented in this file.
44

5+
## 9.1.16
6+
7+
### General
8+
- `IgxSelect`
9+
- Added `aria-labelledby` property for the items list container(marked as `role="listbox"`). This will ensure the users of assistive technologies will also know what the list items container is used for, upon opening.
10+
511
## 9.1.9
612

713
### New Features

projects/igniteui-angular/src/lib/select/select.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[value]="this.selectionValue"
1313
role="combobox"
1414
aria-haspopup="listbox"
15-
[attr.aria-labelledby]="this.label ? this.label.id : ''"
15+
[attr.aria-labelledby]="this.label?.id"
1616
[attr.aria-expanded]="!this.collapsed"
1717
[attr.aria-owns]="this.listId"
1818
[attr.aria-activedescendant]="!this.collapsed ? this.focusedItem?.id : null"
@@ -37,7 +37,8 @@
3737
</div>
3838

3939
<!-- #7436 LMB scrolling closes items container - unselectable attribute is IE specific -->
40-
<div #scrollContainer class="igx-drop-down__list-scroll" unselectable="on" [style.maxHeight]="maxHeight" [attr.id]="this.listId" role="listbox">
40+
<div #scrollContainer class="igx-drop-down__list-scroll" unselectable="on" [style.maxHeight]="maxHeight"
41+
[attr.id]="this.listId" role="listbox" [attr.aria-labelledby]="this.label?.id">
4142
<ng-content select="igx-select-item, igx-select-item-group"></ng-content>
4243
</div>
4344

projects/igniteui-angular/src/lib/select/select.component.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IgxInputState } from './../directives/input/input.directive';
2-
import { Component, ViewChild, DebugElement, OnInit, ViewChildren, QueryList } from '@angular/core';
2+
import { Component, ViewChild, DebugElement, OnInit, ViewChildren, QueryList, ElementRef } from '@angular/core';
33
import { async, TestBed, tick, fakeAsync } from '@angular/core/testing';
44
import { FormsModule, FormGroup, FormBuilder, FormControl, Validators, ReactiveFormsModule, NgForm, NgControl } from '@angular/forms';
55
import { By } from '@angular/platform-browser';
@@ -381,8 +381,11 @@ describe('igxSelect', () => {
381381
const dropdownListElement = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWN_LIST_SCROLL));
382382
const dropdownWrapper = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWN_LIST));
383383
const toggleBtn = fixture.debugElement.query(By.css('.' + CSS_CLASS_TOGGLE_BUTTON));
384+
const labelID = fixture.componentInstance.label1.nativeElement.getAttribute('id');
384385
expect(inputElement.nativeElement.getAttribute('role')).toEqual('combobox');
385386
expect(inputElement.nativeElement.getAttribute('aria-haspopup')).toEqual('listbox');
387+
expect(inputElement.nativeElement.getAttribute('aria-labelledby')).toEqual(labelID);
388+
expect(dropdownListElement.nativeElement.getAttribute('aria-labelledby')).toEqual(labelID);
386389
expect(inputElement.nativeElement.getAttribute('aria-owns')).toEqual(select.listId);
387390
expect(inputElement.nativeElement.getAttribute('aria-expanded')).toEqual('false');
388391
expect(toggleBtn.nativeElement.getAttribute('aria-hidden')).toEqual('true');
@@ -2632,15 +2635,18 @@ describe('igxSelect ControlValueAccessor Unit', () => {
26322635
@Component({
26332636
template: `
26342637
<igx-select #select [width]="'300px'" [height]="'200px'" [placeholder]="'Choose a city'" [(ngModel)]="value">
2635-
<igx-select-item *ngFor="let item of items" [value]="item" [text]="item">
2636-
{{ item }} {{'©'}}
2637-
</igx-select-item>
2638+
<label igxLabel #simpleLabel>Select Simple Component</label>
2639+
<igx-select-item *ngFor="let item of items" [value]="item" [text]="item">
2640+
{{ item }} {{'©'}}
2641+
</igx-select-item>
26382642
</igx-select>
26392643
`
26402644
})
26412645
class IgxSelectSimpleComponent {
26422646
@ViewChild('select', { read: IgxSelectComponent, static: true })
26432647
public select: IgxSelectComponent;
2648+
@ViewChild('simpleLabel', { read: ElementRef, static: true })
2649+
public label1: ElementRef;
26442650
public items: string[] = [
26452651
'New York',
26462652
'Sofia',

0 commit comments

Comments
 (0)