question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebView inside ScrollView problem

See original GitHub issue

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: WebView_ScrollView

Environment:

  • OS: Android
  • OS version: 9
  • react-native version: 0.61.2
  • react-native-webview version: 7.4.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:16

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, May 15, 2020

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

1reaction
Sanan4licommented, Nov 2, 2019

I am getting this error. Invariant Violation: View config not found for name RNCWebView.] if anyone knows solution please share

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android WebView inside ScrollView scrolls only scrollview
In my app I have a ScrollView that contains some linearviews, some textviews and One Webview, then other linear layouts etc. The problem...
Read more >
React Native: Why Your WebView Disappears inside a ...
Placing a WebView inside a Scrollview can be problematic. The problem you would immediately come across is the WebView mysteriously disappearing.
Read more >
WebView inside ScrollView not working · Issue #4773 - GitHub
I noticed that, on version 0.16.0, putting a WebView inside a ScrollView results in a blank page, no error is thrown.
Read more >
WebView inside ScrollView not scrolling. - Microsoft Q&A
WebView inside ScrollView not scrolling. Hi,. I have below code and it does not work for me. The WebView is just not scrolling...
Read more >
WebView inside scroll view drawing issue. [219274495]
If i have WebView inside of ScrollView (or NestedScrollView) WebView loads twitter embed with video -> is causes driving issues:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found