fix(highlight): selected tab might be null

fixes #12054
This commit is contained in:
Manuel Mtz-Almeida
2017-06-15 21:22:12 +02:00
parent c7645ee59d
commit 5a5da39a1e

View File

@@ -15,10 +15,13 @@ export class TabHighlight {
constructor(private _elementRef: ElementRef, private _dom: DomController) {}
select(tab: Tab) {
if (!tab) {
return;
}
const dom = this._dom;
dom.read(() => {
const btnEle: HTMLElement = tab.btn.getElementRef().nativeElement;
const btnEle: HTMLElement = tab.btn.getNativeElement();
const transform = `translate3d(${btnEle.offsetLeft}px,0,0) scaleX(${btnEle.offsetWidth})`;
dom.write(() => {