Skip to content

Commit 5a5da39

Browse files
committed
fix(highlight): selected tab might be null
fixes #12054
1 parent c7645ee commit 5a5da39

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/tabs/tab-highlight.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ export class TabHighlight {
1515
constructor(private _elementRef: ElementRef, private _dom: DomController) {}
1616

1717
select(tab: Tab) {
18+
if (!tab) {
19+
return;
20+
}
1821
const dom = this._dom;
1922

2023
dom.read(() => {
21-
const btnEle: HTMLElement = tab.btn.getElementRef().nativeElement;
24+
const btnEle: HTMLElement = tab.btn.getNativeElement();
2225
const transform = `translate3d(${btnEle.offsetLeft}px,0,0) scaleX(${btnEle.offsetWidth})`;
2326

2427
dom.write(() => {

0 commit comments

Comments
 (0)