Skip to content

Commit

Permalink
fix(highlight): selected tab might be null
Browse files Browse the repository at this point in the history
fixes #12054
  • Loading branch information
manucorporat committed Jun 15, 2017
1 parent c7645ee commit 5a5da39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/tabs/tab-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 5a5da39

Please sign in to comment.