Skip to content

Commit

Permalink
fix(collapse): remove aria-expanded from target
Browse files Browse the repository at this point in the history
Closes #1492
  • Loading branch information
troy authored and pkozlowski-opensource committed Apr 13, 2017
1 parent 513cc1c commit a24b283
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/collapse/collapse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ describe('ngb-collapse', () => {
TestBed.overrideComponent(TestComponent, {set: {template: html}});
});

it('should have content open and aria-expanded true', () => {
it('should have content open', () => {
const fixture = TestBed.createComponent(TestComponent);
fixture.detectChanges();

const collapseEl = getCollapsibleContent(fixture.nativeElement);

expect(collapseEl).toHaveCssClass('show');
expect(collapseEl.getAttribute('aria-expanded')).toBe('true');
});

it('should have content closed and aria-expanded false', () => {
it('should have content closed', () => {
const fixture = TestBed.createComponent(TestComponent);
const tc = fixture.componentInstance;
tc.collapsed = true;
Expand All @@ -39,7 +38,6 @@ describe('ngb-collapse', () => {
const collapseEl = getCollapsibleContent(fixture.nativeElement);

expect(collapseEl).not.toHaveCssClass('show');
expect(collapseEl.getAttribute('aria-expanded')).toBe('false');
});

it('should toggle collapsed content based on bound model change', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/collapse/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Directive, Input} from '@angular/core';
@Directive({
selector: '[ngbCollapse]',
exportAs: 'ngbCollapse',
host: {'[class.collapse]': 'true', '[class.show]': '!collapsed', '[attr.aria-expanded]': '!collapsed'}
host: {'[class.collapse]': 'true', '[class.show]': '!collapsed'}
})
export class NgbCollapse {
/**
Expand Down

0 comments on commit a24b283

Please sign in to comment.