From 709769db3d52282fe4bf47f31d9203664beec9b3 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 26 Aug 2019 15:17:27 +0300 Subject: [PATCH] Fixed scrool issue on feed screen --- src/components/posts/view/postsView.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/components/posts/view/postsView.js b/src/components/posts/view/postsView.js index 633ab2b00..99b50e021 100644 --- a/src/components/posts/view/postsView.js +++ b/src/components/posts/view/postsView.js @@ -340,26 +340,13 @@ class PostsView extends Component { }; _handleOnScroll = event => { - const { scrollOffsetY, isShowFilterBar, lockFilterBar } = this.state; + const { scrollOffsetY } = this.state; const { handleOnScroll } = this.props; const currentOffset = event.nativeEvent.contentOffset.y; - // WORKAROUND - const _showFilterBar = scrollOffsetY > currentOffset || scrollOffsetY <= 0; - const _lockFilterBar = isShowFilterBar !== _showFilterBar; - if (handleOnScroll) handleOnScroll(); this.setState({ scrollOffsetY: currentOffset }); - this.setState({ - isShowFilterBar: lockFilterBar ? isShowFilterBar : _showFilterBar, - lockFilterBar: lockFilterBar || _lockFilterBar, - }); - - if (_lockFilterBar) { - setTimeout(() => { - this.setState({ lockFilterBar: false }); - }, 1000); - } + this.setState({ isShowFilterBar: scrollOffsetY > currentOffset || scrollOffsetY <= 0 }); }; render() { @@ -403,7 +390,7 @@ class PostsView extends Component { onEndThreshold={0} initialNumToRender={10} ListFooterComponent={this._renderFooter} - onScroll={this._handleOnScroll} + onScrollEndDrag={this._handleOnScroll} ListEmptyComponent={this._renderEmptyContent} refreshControl={