Skip to content

Commit 665b18c

Browse files
frobertson-ccbptomasroos
authored andcommitted
Set onScroll handler on tab bar view (ptomasroos#1005)
* adds passing onScroll to ScrollView in ScrollableTabBar * adds throttle to onScroll events of the underlying ScrollView
1 parent c0c9273 commit 665b18c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ScrollableTabBar.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ const ScrollableTabBar = createReactClass({
164164
width: this.state._widthTabUnderline,
165165
};
166166

167+
const {
168+
onScroll,
169+
} = this.props;
170+
167171
return <View
168172
style={[styles.container, {backgroundColor: this.props.backgroundColor, }, this.props.style, ]}
169173
onLayout={this.onContainerLayout}
@@ -176,6 +180,8 @@ const ScrollableTabBar = createReactClass({
176180
directionalLockEnabled={true}
177181
bounces={false}
178182
scrollsToTop={false}
183+
onScroll={onScroll}
184+
scrollEventThrottle={16}
179185
>
180186
<View
181187
style={[styles.tabs, {width: this.state._containerWidth, }, this.props.tabsContainerStyle, ]}

0 commit comments

Comments
 (0)