Skip to content

Commit

Permalink
fix(chips): invalid aria-selected value for non-selectable chip (#6544)
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto authored and kara committed Aug 22, 2017
1 parent 1f4a962 commit 90fc300
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/lib/chips/chip.spec.ts
Expand Up @@ -194,13 +194,8 @@ describe('Chips', () => {
expect(testComponent.chipSelect).not.toHaveBeenCalled();
});

it('should have empty aria-selected', () => {
expect(chipNativeElement.getAttribute('aria-selected')).toBeFalsy();

testComponent.selectable = true;
fixture.detectChanges();

expect(chipNativeElement.getAttribute('aria-selected')).toBe('false');
it('should not have the aria-selected attribute', () => {
expect(chipNativeElement.hasAttribute('aria-selected')).toBe(false);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/lib/chips/chip.ts
Expand Up @@ -121,8 +121,8 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr
/** Emitted when the chip is destroyed. */
@Output() destroy = new EventEmitter<MdChipEvent>();

get ariaSelected(): string {
return this.selectable ? this.selected.toString() : '';
get ariaSelected(): string | null {
return this.selectable ? this.selected.toString() : null;
}

constructor(renderer: Renderer2, elementRef: ElementRef) {
Expand Down

0 comments on commit 90fc300

Please sign in to comment.