-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
WebView onLoadEnd never get call (iOS) #18802
Comments
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? Thank you for your contributions. |
I can confirm this issue |
i can confirm issue too |
i can confirm issue too, android platform |
When you use In // we only need the final 'finishLoad' call so only fire the event when we're actually done loading.
else if (_onLoadingFinish && !webView.loading && ![webView.request.URL.absoluteString isEqualToString:@"about:blank"]) {
_onLoadingFinish([self baseEvent]);
} Setting an empty url in <WebView
source={{ html: `<h1>Hello World<h1>`, baseUrl: '' }}
onLoadEnd={e => console.log('end', e)}
onLoadStart={e => console.log('start', e)}
onError={e => console.log('error', e)}
/> |
you have solved my problem |
v0.56.0 This issue will solve when RN use WKWebView instead of UIWebView. |
I'm not planning to migrate this issue to https://github.com/react-native-community/react-native-webview as @soyanakagawa indicated that using WKWebView will fix it, and we're defaulting to WKWebView over there. If you want, you can try that package and see if your issues are resolved. If so, we could probably close this issue. |
There has been no further interaction here so I feel safe in closing per comment above |
Fix the issue where `onLoad` and `onLoadEnd` were not triggered after the view was loaded. This happens because `url` is `about://(null)` in iOS when using `html` in source like this: `source={{ html }}`. Setting the `baseUrl` parameter on the prop fixes the issue. For reference : facebook/react-native#18802 (comment) #2
Fix the issue where `onLoad` and `onLoadEnd` were not triggered after the view was loaded. This happens because `url` is `about://(null)` in iOS when using `html` in source like this: `source={{ html }}`. Setting the `baseUrl` parameter on the prop fixes the issue. For reference : facebook/react-native#18802 (comment) #2
this works for me, thanks |
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.4
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.0 => 0.54.0
Steps to Reproduce
Snack
Expected Behavior
It should both log start and end.
Actual Behavior
Only start event is logged.
The text was updated successfully, but these errors were encountered: