From df7552135a50d715a50ab592874eb84fc7c8bbcf Mon Sep 17 00:00:00 2001 From: Ansh Date: Thu, 6 Jul 2023 18:41:27 -0700 Subject: [APP-703] Android horizontal scroll registers as tap (#960) * use Touchables from react-native-gesture-handler * upgrade `react-native-gesture-handler` to latest version * add FixedTouchableHighlight for android * add workaround comment * wait for animations to complete before loading data * downgrade RNGH back to the version we had --- src/view/screens/PostThread.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/view/screens/PostThread.tsx') diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index e3ceb0bef..86b2d3027 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -1,5 +1,5 @@ import React, {useMemo} from 'react' -import {StyleSheet, View} from 'react-native' +import {InteractionManager, StyleSheet, View} from 'react-native' import {useFocusEffect} from '@react-navigation/native' import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' import {makeRecordUri} from 'lib/strings/url-helpers' @@ -31,11 +31,15 @@ export const PostThreadScreen = withAuthRequired(({route}: Props) => { React.useCallback(() => { store.shell.setMinimalShellMode(false) const threadCleanup = view.registerListeners() - if (!view.hasLoaded && !view.isLoading) { - view.setup().catch(err => { - store.log.error('Failed to fetch thread', err) - }) - } + + InteractionManager.runAfterInteractions(() => { + if (!view.hasLoaded && !view.isLoading) { + view.setup().catch(err => { + store.log.error('Failed to fetch thread', err) + }) + } + }) + return () => { threadCleanup() } -- cgit 1.4.1