[Crash] WebView inside ScrollView crash on scroll end - Android
See original GitHub issueBug description: When I try to put a webview inside a scroll view along with other native content, the app crashes when scroll reaches the end. I have tried various different possibilities to check if it has something to do with my code but it seems otherwise.
Things work fine on iOS side, only Android side crashes.
To Reproduce: Even a simple code as this one below should reproduce the bug, it does on my side.
const dummyString = `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.`
const html = '<p>This is web body</p>'
return (
<ScrollView>
<WebView style={{height:200}} scrollEnabled={false} source={{html}} ></WebView>
<Text>{dummyString}</Text>
</ScrollView>
);
Example app with reproduction code: https://github.com/noumantahir/react-native-webview-scrollview-crash
Screenshots/Videos:
https://user-images.githubusercontent.com/6298342/152299012-d684fbe6-3f45-4e60-96ff-2a86cf0c7c5a.mov
Environment:
- OS: Android
- OS version: 31
- react-native version: 0.67.2
- react-native-webview version: 11.17.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:20
Top Results From Across the Web
android - Adding scrollview crashes app - Stack Overflow
My case is different. I put it here for some one got the problem like me. The scrollview can contain only ONE child...
Read more >Animate a scroll gesture - Android Developers
In Android, scrolling is typically achieved by using the ScrollView class. ... the container indicates that the user has reached the end of...
Read more >Untitled
android : horizontal ScrollView cannot scroll in other scrollable (724d4af) ... ios: fix border bottom color display error (1f342b2); ios: fix crash due...
Read more >RecyclerView within NestedScrollView Scrolling Issue - Medium
The solution for this is we need to use nestedScrollView instead of scrollview like the below code snippet: Now what kinda problem occurred...
Read more >WKWebView issue in iOS 16 beta | Apple Developer Forums
I set up the code, but the webView can still slide up and down. I assigned a color to the scrollView, I'm sure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@noumantahir Did you try to add
overScrollMode="never"
?https://reactnative.dev/docs/scrollview#overscrollmode-android
Thanks for the tip @phuongwd this worked like a charmm, saved us so much frustration…