Skip to content

Commit 7ddf7e3

Browse files
authored
Merge pull request #23 from itenl/dev-1.1.5
Dev 1.1.5
2 parents 3da3b15 + 3b30c70 commit 7ddf7e3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@itenl/react-native-scrollable-tabview",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "react-native-scrollable-tabview",
55
"main": "index.js",
66
"scripts": {

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export default class ScrollableTabView extends React.Component {
438438
const pluginName = packagejson.name;
439439
const msg = `${pluginName}: ${message || ' --- '}`;
440440
console[level](msg);
441-
if (errorToThrow) throw new Error(msg);
441+
if (errorToThrow && level == CONSOLE_LEVEL.ERROR) throw new Error(msg);
442442
}
443443

444444
_errorProps(propName, level) {
@@ -480,12 +480,12 @@ export default class ScrollableTabView extends React.Component {
480480
horizontal={true}
481481
>
482482
{this.tabs.map((tab, index) => this._renderTab({ item: tab, index }))}
483-
{tabsEnableAnimated && this._renderAnimatedTabUnderline()}
483+
{tabsEnableAnimated && this.state.checkedIndex !== null && this._renderAnimatedTabUnderline()}
484484
</ScrollView>
485485
) : (
486486
<View style={_tabsStyle}>
487487
{this.tabs.map((tab, index) => this._renderTab({ item: tab, index }))}
488-
{tabsEnableAnimated && this._renderAnimatedTabUnderline()}
488+
{tabsEnableAnimated && this.state.checkedIndex !== null && this._renderAnimatedTabUnderline()}
489489
</View>
490490
))
491491
);
@@ -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)