react / react/react-native

Touches not registering/executing on FlatList/ScrollView when navigating back to the screen with a scrolling list (IOS)

Offen
#35,921 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Component: FlatList Component: ScrollView Issue: Author Provided Repro Platform: iOS
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

If we navigate to a new screen while a list component is currently scrolling and come back to this screen, the touch does not work on the previously scrolling list. Once i manually scroll the list again and scroll ends only after that touch starts to work on the children of the FlatList or ScrollView

The List component can be either ScrollView or FlatList.

Version

0.66.0, 0.69.0

Output of npx react-native info

System:
OS: macOS 12.1
CPU: (8) x64 Apple M1 Pro
Memory: 28.88 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.10.0 - ~/.nvm/versions/node/v14.10.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v14.10.0/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.10.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.6 => 0.69.6
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Step 1: Create a ScrollView or Flatlist with navigation to a new Page on item click.

Step 2: Initiate a flick gesture on the list, to introduce a scroll from the 0th to the Nth position.

Step 3: While the list is scrolling, click on any other clickable component such as the search bar or any other clickable widget which has navigation attached to it.

Step 4: You will be navigated to a new screen. Now navigate to the previous screen.

Step 5: Click on any child component of the previously scrolling list.

Step 6: Nothing will happen until you manually scroll the list and it reaches an idle scroll position

Snack, code example, screenshot, or link to a repository

import React, { Component } from 'react';
import { View, Text, TouchableOpacity, SafeAreaView, FlatList, ScrollView } from 'react-native';

const App = ()=> {

const renderListItem = ({ item, index }: any) => {
return (

<ScrollView
onScroll={() => {
console.log(" onScroll called scrollview");
}
}
scrollEventThrottle={16}
horizontal

  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
  <Text>selected</Text>
   <TouchableOpacity
   style={{backgroundColor: 'yellow', padding: 20}}
   onPress={() =>console.log('on Press')}>
   <Text>Count</Text>

 </TouchableOpacity>
 </View>
);

};

return (

<FlatList
data={['']}
renderItem={renderListItem}
onScroll={() => {
console.log(" onScroll called Flatlist ");
}
}
/>

);
}
export default App

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem unter iOS mit dem bereitgestellten ScrollView- oder FlatList-Beispiel zu reproduzieren, und befolge dabei die Navigations- und Flick-Gesten-Schritte. Verfolge das Touch- und Scrollverhalten, wenn zum vorherigen Bildschirm zurückgekehrt wird. Als erledigt gilt die Aufgabe, wenn untergeordnete Komponenten unmittelbar nach der Rückkehr auf Touches reagieren, ohne dass ein weiterer manueller Scrollvorgang erforderlich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.