Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIGRATED: The use of postMessage will lead to WebView onLoadStart run Twice (#16547) #9

Closed
jamonholmgren opened this issue Sep 10, 2018 · 3 comments
Labels
in progress A pull request is in progress to fix this issue migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+ Type: bug report

Comments

@jamonholmgren
Copy link
Member

Migrated from facebook/react-native#16547.

@TrustTheBoy says:


Environment
OS: macOS Sierra 10.12.6
Node: v7.10.0
Yarn: 0.27.5
npm: 4.2.0
Watchman: 4.7.0
Xcode: Xcode Version 9.1 beta (9B37)
Android Studio: 2.3
react-native: 0.48.4
react: 16.0.0-alpha.12
Target Platform: iOS (8-11.1) android(4.4.4-8.0)

Steps to Reproduce
messtest = e => {
const message = e.nativeEvent.data
alert(message)
}
<WebView
ref={w => this.webview = w}
source={{uri:jumpUrl}}
onMessage={this.messtest}
domStorageEnabled={true}
javaScriptEnabled={true}
startInLoadingState={true}
dataDetectorTypes="none"
onLoadEnd={()=>{
console.log('load end... onLoadEnd function');
}}
onLoadStart={()=>{
console.log('load start..');
}}
renderLoading={this._renderLoading}
//onNavigationStateChange={this.onNavigationStateChange}
/>
image

Expected Behavior
LoadStart should be executed before loadEnd,As you can see from the diagram, load end... re executes load start, and then does not execute load end, which causes the state to be updated. It has always been load start


More info in original issue thread

@jamonholmgren jamonholmgren added the migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+ label Sep 10, 2018
@Titozzz
Copy link
Collaborator

Titozzz commented Oct 21, 2018

Will probably need to be closed once #66 is solved

ankur-sardar added a commit to lunascape/react-native-webview that referenced this issue Oct 25, 2018
show dialouge box when ask for geo location permission in android web…
@jamonholmgren jamonholmgren added bug in progress A pull request is in progress to fix this issue labels Dec 21, 2018
@1111mp
Copy link

1111mp commented Mar 27, 2019

@Titozzz How to solve it in IOS

@Ehesp
Copy link

Ehesp commented Apr 3, 2019

Closing as fixed in #66 - if this is still an issue let us know and we'll re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress A pull request is in progress to fix this issue migrated Migrated from https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+ Type: bug report
Projects
None yet
Development

No branches or pull requests

4 participants