Skip to content

Commit

Permalink
fix(material/chips): use checkmark graphic for single-selection (#25890)
Browse files Browse the repository at this point in the history
For mat-chip-listbox, use the checkmark component for single-selection.
Fixes issue where selected state is communicated visually only using
color (#25886).

(cherry picked from commit a999a52)
  • Loading branch information
zarend committed Nov 3, 2022
1 parent ec116ab commit 8643c9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/material/chips/chip-option.ts
Expand Up @@ -164,8 +164,10 @@ export class MatChipOption extends MatChip implements OnInit {
}

_hasLeadingGraphic() {
// The checkmark graphic is built in for multi-select chip lists.
return this.leadingIcon || (this._chipListMultiple && this.selectable);
// The checkmark graphic communicates selected state for both single-select and multi-select.
// Include checkmark in single-select to fix a11y issue where selected state is communicated
// visually only using color (#25886).
return this.leadingIcon || this.selectable;
}

_setSelectedState(isSelected: boolean, isUserInput: boolean, emitEvent: boolean) {
Expand Down

0 comments on commit 8643c9c

Please sign in to comment.