Skip to content

Commit

Permalink
Fixed #7169 - Screen reader support for multiselect, dropdown and lis…
Browse files Browse the repository at this point in the history
…tbox options
  • Loading branch information
cagataycivici committed Jan 24, 2019
1 parent 5ea0326 commit d7970bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const DROPDOWN_VALUE_ACCESSOR: any = {
<ng-container *ngTemplateOutlet="itemslist; context: {$implicit: optionsToDisplay, selectedOption: selectedOption}"></ng-container>
</ng-container>
<ng-template #itemslist let-options let-selectedOption="selectedOption">
<li *ngFor="let option of options;let i=index" (click)="onItemClick($event, option)" role="option"
<li *ngFor="let option of options;let i=index" (click)="onItemClick($event, option)" role="option" [attr.aria-label]="option.label"
[ngClass]="{'ui-dropdown-item ui-corner-all':true,
'ui-state-highlight':(selectedOption == option),
'ui-state-disabled':(option.disabled),
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const LISTBOX_VALUE_ACCESSOR: any = {
<div class="ui-listbox-list-wrapper" [ngStyle]="listStyle">
<ul class="ui-listbox-list">
<li *ngFor="let option of options; let i = index;" [style.display]="isItemVisible(option) ? 'block' : 'none'" [attr.tabindex]="option.disabled ? null : '0'"
[ngClass]="{'ui-listbox-item ui-corner-all':true,'ui-state-highlight':isSelected(option), 'ui-state-disabled': option.disabled}"
[ngClass]="{'ui-listbox-item ui-corner-all':true,'ui-state-highlight':isSelected(option), 'ui-state-disabled': option.disabled}" [attr.aria-label]="option.label"
(click)="onOptionClick($event,option)" (dblclick)="onOptionDoubleClick($event,option)" (touchend)="onOptionTouchEnd($event,option)" (keydown)="onOptionKeyDown($event,option)">
<div class="ui-chkbox ui-widget" *ngIf="checkbox && multiple">
<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default" [ngClass]="{'ui-state-active':isSelected(option)}">
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const MULTISELECT_VALUE_ACCESSOR: any = {
@Component({
selector: 'p-multiSelectItem',
template: `
<li class="ui-multiselect-item ui-corner-all" (click)="onOptionClick($event)" (keydown)="onOptionKeydown($event)"
<li class="ui-multiselect-item ui-corner-all" (click)="onOptionClick($event)" (keydown)="onOptionKeydown($event)" [attr.aria-label]="option.label"
[style.display]="visible ? 'block' : 'none'" [attr.tabindex]="option.disabled ? null : '0'" [ngStyle]="{'height': itemSize + 'px'}"
[ngClass]="{'ui-state-highlight': selected, 'ui-state-disabled': (option.disabled || (maxSelectionLimitReached && !selected))}">
<div class="ui-chkbox ui-widget">
Expand Down

0 comments on commit d7970bd

Please sign in to comment.