Gaurav Tripathi
Gaurav Tripathi

Reputation: 1355

Getting jerks while slowly scrolling react native webview/webshell NaiveAutoheightWebView

<NaiveAutoheightWebView
            key={`webview-${i}`}
            androidHardwareAccelerationDisabled
            overScrollMode="never"
            androidLayerType={'none'}
            javaScriptEnabled={true}
            scrollEnabled={false}
            bounces={false}
            javaScriptEnabledAndroid={true}
            allowsFullscreenVideo={false}
            ignoreSslError={true}
            source={{ html: seperateHtml(parts[i]) }}
            scalesPageToFit={true}
            onMessage={onWebViewMessage}
            contentInsetAdjustmentBehavior="automatic"
            injectedJavaScript={`
                            document.body.style.userSelect = 'none';
                            window.ReactNativeWebView.postMessage(Math.max(document.body.offsetHeight, document.body.scrollHeight));
                            `}
            startInLoadingState={true}
            onLoad={() => {
              setLoadingWebview(false);
            }}
            onLoadEnd={() => {
              setLoadingWebview(false);
            }}
            onError={() => {
              setLoadingWebview(false);
            }}
            parentMsid={htmlBody?.msid}
          />

While scrolling slowly on android/ios, it suddenly scrolls the page up and every time have to find last read line.

Upvotes: 0

Views: 29

Answers (0)

Related Questions