mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-05 04:28:03 +03:00
Merge pull request #1083 from esteemapp/bugfix/feed-scrool
Fixed scrool issue on feed screen
This commit is contained in:
commit
72acabf2db
@ -340,26 +340,13 @@ class PostsView extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_handleOnScroll = event => {
|
_handleOnScroll = event => {
|
||||||
const { scrollOffsetY, isShowFilterBar, lockFilterBar } = this.state;
|
const { scrollOffsetY } = this.state;
|
||||||
const { handleOnScroll } = this.props;
|
const { handleOnScroll } = this.props;
|
||||||
const currentOffset = event.nativeEvent.contentOffset.y;
|
const currentOffset = event.nativeEvent.contentOffset.y;
|
||||||
|
|
||||||
// WORKAROUND
|
|
||||||
const _showFilterBar = scrollOffsetY > currentOffset || scrollOffsetY <= 0;
|
|
||||||
const _lockFilterBar = isShowFilterBar !== _showFilterBar;
|
|
||||||
|
|
||||||
if (handleOnScroll) handleOnScroll();
|
if (handleOnScroll) handleOnScroll();
|
||||||
this.setState({ scrollOffsetY: currentOffset });
|
this.setState({ scrollOffsetY: currentOffset });
|
||||||
this.setState({
|
this.setState({ isShowFilterBar: scrollOffsetY > currentOffset || scrollOffsetY <= 0 });
|
||||||
isShowFilterBar: lockFilterBar ? isShowFilterBar : _showFilterBar,
|
|
||||||
lockFilterBar: lockFilterBar || _lockFilterBar,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (_lockFilterBar) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.setState({ lockFilterBar: false });
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -403,7 +390,7 @@ class PostsView extends Component {
|
|||||||
onEndThreshold={0}
|
onEndThreshold={0}
|
||||||
initialNumToRender={10}
|
initialNumToRender={10}
|
||||||
ListFooterComponent={this._renderFooter}
|
ListFooterComponent={this._renderFooter}
|
||||||
onScroll={this._handleOnScroll}
|
onScrollEndDrag={this._handleOnScroll}
|
||||||
ListEmptyComponent={this._renderEmptyContent}
|
ListEmptyComponent={this._renderEmptyContent}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
|
Loading…
Reference in New Issue
Block a user