SectionList's `onScrollToIndexFailed` does not catch requested sectionIndex & itemIndex
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C++
- Sterne
- 127k
- Forks
- 25.3k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
Description
onScrollToIndexFailed returns index,heighestMeasuredIndex, and averageItemHeight, which is enough in FlatList.
but in sectionList it should return requested sectionIndex and itemIndex, and heighestMeasured section & item index in addition to flat index, because we have only scrollToLocation method available for sectionList and section and item index params are needed.
Steps to reproduce
run the snack, press on scroll to no where, you will see the alert
React Native Version
0.76.3
Affected Platforms
Runtime - Android, Runtime - iOS, Runtime - Web, Runtime - Desktop, Build - MacOS, Build - Windows, Build - Linux
Output of npx react-native info
System:
OS: Windows 11 10.0.22000
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 8.47 GB / 15.89 GB
Binaries:
Node:
version: 23.0.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.0
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 10.9.0
path: C:\Program Files\nodejs\npm.CMD
Watchman:
version: 20241027.093345.0
path: E:\Software\Watchman\bin\watchman.EXE
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Disabled
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java:
version: 21.0.3
path: /c/Program Files/Eclipse Adoptium/jdk-21.0.3.9-hotspot/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.2
wanted: 0.76.2
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
scroll to index failed
Reproducer
https://snack.expo.dev/@arasrezaie/sectionlist-example
Screenshots and Videos
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem verknüpften Expo Snack und reproduziere das fehlgeschlagene SectionList-Scrollen mithilfe von onScrollToIndexFailed. Verfolge den Callback-Vertrag von SectionList und seine Eingaben für scrollToLocation; überprüfe anschließend, dass das Fehlerergebnis zusätzlich zum flachen Index, der Höhe und der durchschnittlichen Elementhöhe den angeforderten sowie den höchsten gemessenen Abschnitts- und Elementindex enthält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react-native
- Bereich
- mobile
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100