From 4aeda3f7788fb13f82de1f85f4eb8847d2f0c87c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 29 Nov 2022 16:11:50 -0300 Subject: [PATCH] Try to fix LayoutAnimation on RoomsListView --- app/views/RoomsListView/index.tsx | 42 +++++++++++++++---------------- app/views/RoomsListView/styles.ts | 3 --- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index 8a379373d..9b36191f4 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -368,6 +368,7 @@ class RoomsListView extends React.Component void ) => { if (this.animated) { + this.scroll?.prepareForLayoutAnimationRender(); animateNextTransition(); } this.setState(state, callback); @@ -774,10 +775,7 @@ class RoomsListView extends React.Component { - // Run only when we're not grouping by anything - if (!this.isGrouping) { - this.getSubscriptions(); - } + this.getSubscriptions(); }; getScrollRef = (ref: any) => (this.scroll = ref); @@ -870,23 +868,25 @@ class RoomsListView extends React.Component - } - onEndReached={this.onEndReached} - onEndReachedThreshold={0.5} - /> + + + ) + } + onEndReached={this.isGrouping ? this.onEndReached : undefined} + onEndReachedThreshold={this.isGrouping ? 0.5 : undefined} + /> + ); }; diff --git a/app/views/RoomsListView/styles.ts b/app/views/RoomsListView/styles.ts index 80b19c89a..0071c6237 100644 --- a/app/views/RoomsListView/styles.ts +++ b/app/views/RoomsListView/styles.ts @@ -6,9 +6,6 @@ export default StyleSheet.create({ container: { flex: 1 }, - list: { - width: '100%' - }, dropdownContainerHeader: { height: 41, borderBottomWidth: StyleSheet.hairlineWidth,