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 scroll issue in Android

See original GitHub issue

Bug description: Webview scrolls not working in Android.

import { WebView as RNWebView } from 'react-native-webview';
<RNWebView
  source={{ uri: url }}
  originWhitelist={['*']}
  mediaPlaybackRequiresUserAction
  startInLoadingState={true}
  onLoadStart={onLoadStart}
  onLoad={onLoad}
  incognito={incognito}
  hideKeyboardAccessoryView={true}
  renderLoading={() => <Loader visible variant="light" />}
/>

The Webview is inside of a View

Environment:

  • OS: Android
  • OS version: 9
  • react-native version: 0.66.0
  • react-native-webview version:11.6.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17

github_iconTop GitHub Comments

4reactions
nvijaya24commented, Apr 5, 2022

If WebView inside ScrollView just remove ScrollView that will work

3reactions
afras21commented, Oct 10, 2022

Same issue, the scroll doesn’t work properly in android, it “kinda” jumps up if you scrolling down and the other way around. Using the webview with these properties, and tried to wrap it up with ScrollView but didn’t work. <WebView incognito ref={webViewRef} injectedJavaScript={...} showsVerticalScrollIndicator={false} showsHorizontalScrollIndicator={false} androidHardwareAccelerationDisabled={true} cacheEnabled={false} cacheMode="LOAD_NO_CACHE" onLoad={() => setData()} onNavigationStateChange={...} source={{ uri: }} onMessage={...} key={webKey} onContentProcessDidTerminate={...} />

Environment: OS: Android OS version: 9

Had exactly same issue and got a fix now. in android manifest change android:hardwareAcclerated="false" to android:hardwareAccelerated="true"

            <WebView
                ref={webview}
                source={webViewSource}
                onNavigationStateChange={handleWebviewNavigation}
                onLoadStart={stopLoading}
                renderLoading={renderLoadingView}
                userAgent={userAgent}
                onMessage={props?.onWebEvent}
                onError={handleWebviewError}
                scalesPageToFit={scalesPageToFit}
                startInLoadingState
                allowsInlineMediaPlayback
                javaScriptEnabled
                allowFileAccessFromFileURLs
                allowsFullscreenVideo
                injectedJavaScriptForMainFrameOnly
                nestedScrollEnabled
                allowFileAccess
                mediaPlaybackRequiresUserAction={false}
                cacheEnabled={false}
                bounces={false}
                scrollEnabled={false}
                androidLayerType={'hardware'}
            />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android WebView isn't scrollable - Stack Overflow
If your WebView has the same height as its content, then there's never anything to scroll as obviously the content all fits by...
Read more >
Android webview scroll and facebook comments problem ...
Android webview scroll and facebook comments problem when Admob loads advert. There is bizarre behavior in Android when you combine a “WebView” together ......
Read more >
WebView/WebViewProvider needs to support nested scrolling ...
I think the key problem here is that when a scroll happens inside WebView, the touch event is never intercepted (in contrast to...
Read more >
Webview scroll isuue on Android - Design - Adalo - Forum
Hi to all, I have an issue on Android: the webview mudule scrolling. My screen page is composed by: App top bar; A...
Read more >
Content in webview is not rendering on scroll on Android L ...
Example URL: Steps to reproduce the problem: Steps: 1. Loading an website in WebView control. ... area. Though I know that content is...
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