Skip to content

Commit

Permalink
fix(sidenav): align text at start (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
kara authored Sep 21, 2016
1 parent b284dd4 commit 0e0ff0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/sidenav/sidenav.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ describe('MdSidenav', () => {
expect(sidenavEl.classList).toContain('md-sidenav-opened');
});

it('should remove align attr from DOM', () => {
const fixture = TestBed.createComponent(BasicTestApp);
fixture.detectChanges();

const sidenavEl = fixture.debugElement.query(By.css('md-sidenav')).nativeElement;
expect(sidenavEl.hasAttribute('align'))
.toBe(false, 'Expected sidenav not to have a native align attribute.');
});

});

});
Expand Down
2 changes: 2 additions & 0 deletions src/lib/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class MdDuplicatedSidenavError extends MdError {
template: '<ng-content></ng-content>',
host: {
'(transitionend)': '_onTransitionEnd($event)',
// must prevent the browser from aligning text based on value
'[attr.align]': 'null'
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
Expand Down

0 comments on commit 0e0ff0e

Please sign in to comment.