react-native-webview / react-native-webview

React Native Cross-Platform WebView
https://github.com/react-native-community/discussions-and-proposals/pull/3
MIT License
6.3k stars 2.95k forks source link

Android: WebView showing renderLoading for hash changes #3419

Closed psbdgr8 closed 1 month ago

psbdgr8 commented 1 month ago

Bug description:

Whenever there's a change in the URL with hash changes, the webview shows a loader on Android, but it works fine on iOS. For example, if the URL is: https://www.example.com/ and it changes to: https://www.example.com/#sbfbu=1&pi=, the renderLoading is triggered on Android, but it's working fine on iOS with no loader showing.

To Reproduce:

<WebView startInLoadingState={true} ref={webViewRef} source={{uri: 'https://www.example.com'}} allowFileAccess={true} originWhitelist={['*']} javaScriptEnabled={true} automaticallyAdjustContentInsets={true} domStorageEnabled={true} allowsFullscreenVideo={true} onMessage={onMessage} mediaPlaybackRequiresUserAction={false} dataDetectorTypes={'none'} injectedJavaScript={msg_injectedJavascript} renderLoading={Loader} onLoadStart={ShowLoader} onLoad={HideLoader} onLoadEnd={OnLoad} onError={WebViewError} injectedJavaScriptBeforeContentLoaded={msg_injectedJavascript} style={{ height: height, width:width }} />

Expected behaviour:

No loader should be visible on Android for hash changes either.

Environment: