Skip to content

Commit 3be3d92

Browse files
committed
opt: onTabviewChange
1 parent f5c52d2 commit 3be3d92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ export default class ScrollableTabView extends React.Component {
520520
}
521521

522522
_onTabviewChange(isCarouselScroll, index) {
523+
if (!this.stacks.length) return;
524+
if (!this.stacks[index]) return;
523525
const { enableCachePage, toHeaderOnTab, toTabsOnTab, onTabviewChanged } = this.props;
524526
if (index == this.state.checkedIndex) {
525527
if (!isCarouselScroll && toHeaderOnTab) return this._scrollTo(-this.layoutHeight['header']);

0 commit comments

Comments
 (0)