Skip to content

Commit 0e0ff0e

Browse files
authored
fix(sidenav): align text at start (#1297)
1 parent b284dd4 commit 0e0ff0e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/lib/sidenav/sidenav.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ describe('MdSidenav', () => {
226226
expect(sidenavEl.classList).toContain('md-sidenav-opened');
227227
});
228228

229+
it('should remove align attr from DOM', () => {
230+
const fixture = TestBed.createComponent(BasicTestApp);
231+
fixture.detectChanges();
232+
233+
const sidenavEl = fixture.debugElement.query(By.css('md-sidenav')).nativeElement;
234+
expect(sidenavEl.hasAttribute('align'))
235+
.toBe(false, 'Expected sidenav not to have a native align attribute.');
236+
});
237+
229238
});
230239

231240
});

src/lib/sidenav/sidenav.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export class MdDuplicatedSidenavError extends MdError {
3838
template: '<ng-content></ng-content>',
3939
host: {
4040
'(transitionend)': '_onTransitionEnd($event)',
41+
// must prevent the browser from aligning text based on value
42+
'[attr.align]': 'null'
4143
},
4244
changeDetection: ChangeDetectionStrategy.OnPush,
4345
encapsulation: ViewEncapsulation.None,

0 commit comments

Comments
 (0)