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.31k stars 2.96k forks source link

[Android] In React Native WebView version 13.7 or later, navigation events via window.reactNativeWeview.postMessage() work on the first webview screen but fail after navigating to a new screen #3390

Closed sossost closed 2 months ago

sossost commented 2 months ago

Bug description: When controlling the navigation of an Android app using window.reactNativeWeview.postMessage() on a web screen run as a web view in React Native Web View version 13.7 (or 13.0 or later), the navigation event works well on the first web view screen, but even once Navigation events do not work when the webview screen is moved via postMessage.

Navigation from web view screen 1 to web view screen 2 operates normally. In web view screen 2, all navigation events through postMessage do not work.

To Reproduce: MainScreen displays a specific web screen through React Native webview. When I press any button it navigates to the SubScreen via postMessage. SubScreen displays a specific web screen through React Native webview. In SubScreen, navigation does not work even if you press the header back button or go to another screen.

Expected behavior: Navigation events should work the same way as on the first screen.

Screenshots/Videos: If applicable, add screenshots to help explain your problem. If I lower the React Native version to 11.17.2, it works normally.

Environment:

OS: Android OS version: 13 react-native version: 13.7 react-native-webview version: 0.73.2

ad-walker commented 2 months ago

3368

TheAlmightyBob commented 2 months ago

This should be fixed in v13.8.5 via #3394