Skip to content

Commit f0b20b5

Browse files
committed
fix(sidenav): align text at start
1 parent b284dd4 commit f0b20b5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/lib/sidenav/sidenav.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ 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.getAttribute('align')).toBe(null);
235+
});
236+
229237
});
230238

231239
});

src/lib/sidenav/sidenav.ts

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

0 commit comments

Comments
 (0)