Android: Scroll View Stretch Effect Inconsistency
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- android, react-native
- Bereich
- mobile-dev
Rechercherichtung
Beginnen Sie damit, den obligatorischen Reproducer auszuführen, und vergleichen Sie das Verhalten der vertikalen und horizontalen ScrollView mit overScrollMode="always". Lesen Sie die Logik von Android ScrollView in onInterceptTouchEvent und canScrollVertically und verfolgen Sie anschließend die Integration von React Native ScrollView. Als abgeschlossen gilt es, wenn das Ziehen von einem Child den vertikalen Dehnungseffekt erzeugt, ohne unbeabsichtigte Änderungen an der Barrierefreiheit oder am verschachtelten Scrollen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Tested on Android Pixel 9.
I am trying to understand an issue. I found some threads. #35424 and #47021. When I use a ScrollView with overScrollMode="always" and the content is smaller than the ScrollView the stretch effect does not show when I drag on a child view.. It works fine when I use a horizontal scroll.
I looked into Androids ScrollView code. It has a return in onInterceptTouchEvent:
// Don't try to intercept touch if we can't scroll anyway.
if (getScrollY() == 0 && !canScrollVertically(1)) {
return false;
}
Is this a correct fix?
@Override
boolean canScrollVertically(int direction) {
return super.canScrollVertically(direction)
|| (direction > 0. MScrollEnabled && getOverScrollMode() == OVER_SCROLL_ALWAYS);
}
If I set ALWAYS the view can give feedback. So reporting it as scrollable will fix the issue... Accessibility and nested-scroll parents will also see the view, as scrollable in that mode.
Steps to reproduce
Create a ScrollView with some text children:
<ScrollView style={{ height: 150 }} overScrollMode="always">
<Text style={{ padding: 8 }}>Row one</Text>
<Text style={{ padding: 8 }}>Row two</Text>
</ScrollView>
The difference:
- If I set the scroll to horizontal there is a visible Stretch effect no matter where I drag from.
- If I set it to vertical it does not work when I tap and drag from the Text.
React Native Version
React-native 0.85.3
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 26.5.1
CPU: (12) arm64 Apple M2 Pro
Memory: 316.38 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 24.1.0
path: /Users/davidmalesevic/.nvm/versions/node/v24.1.0/bin/node
Yarn: Not Found
npm:
version: 11.7.0
path: /Users/davidmalesevic/.nvm/versions/node/v24.1.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.5
- iOS 26.5
- macOS 26.5
- tvOS 26.5
- visionOS 26.5
- watchOS 26.5
Android SDK: Not Found
IDEs:
Android Studio: 2025.2 AI-252.28238.7.2523.14688667
Xcode:
version: 26.6/17F113
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.18
path: /opt/homebrew/opt/openjdk@17/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.85.3
wanted: 0.85.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
N/A
MANDATORY Reproducer
https://github.com/Alforofous/rn-vertical-stretch-repro
Screenshots and Videos
- Vorherrschende Sprache
- C++
- Sterne
- 127k
- Forks
- 25.3k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus react/react-native
-
Needs: Author Feedback Needs: Repro
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
react/react-native#58659 · 1 Kommentar ·
-
Needs: Author Feedback Needs: Repro
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
react/react-native#58621 · 1 Kommentar ·
-
Needs: Author Feedback Needs: Repro
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
react/react-native#58610 · 1 Kommentar ·
-
Needs: Triage :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
react/react-native#58565 · 1 Kommentar · 2 Reaktionen ·
-
Needs: Author Feedback Needs: Repro
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
react/react-native#58555 · 5 Kommentare · 2 Reaktionen ·
Alle Issues in react/react-native
Ähnliche Issues
-
[CI] Nightly Clang build broken: structured binding captured in a lambda in FileDataSource.cpp Offenbug build
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Offenfuzz
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ClickHouse/ClickHouse#122114 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
module/agent platform/macos type/bug/regression
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
enhancement PyCDE
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100