react-native-webview: WebView inside ScrollView problem
Bug description: We are using a WebView inside a ScrollView to display other RN components above or below the WebView. This worked perfectly fine before upgrading from RN 0.59.10 to 0.60.5 and above. Now we’re facing an annoying bug (on Android, iOS works fine) where the ScrollView automatically scrolls to the WebView’s position when tapping the WebView (see video). That behaviour only occurs for the first tap after the initial rendering.
To Reproduce:
return (
<ScrollView>
<Text style={{ fontSize: 20 }}>Native Component</Text>
<Text>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</Text>
<Text style={{ fontSize: 20 }}>WebView</Text>
<WebView style={{ height: 1000 }} source={{ uri: 'https://www.lipsum.com/' }} />
</ScrollView>
);
Expected behavior: The ScrollView should not scroll to the WebView’s position. It should keep it scroll position.
Screenshots/Videos:
Environment:
- OS: Android
- OS version: 9
- react-native version: 0.61.2
- react-native-webview version: 7.4.2
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 16
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
I am getting this error. Invariant Violation: View config not found for name RNCWebView.] if anyone knows solution please share
Can confirm this, having the same issue…