mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
fix(onShouldStartLoadWithRequest): android event was missing fields (#385)
`onShouldStartLoadWithRequest` event had only `url` in payload on android. I've fixed it according to js event definition. https://github.com/react-native-community/react-native-webview/blob/master/js/WebViewTypes.js#L34
This commit is contained in:
committed by
Thibault Malbranche
parent
455e22e3b3
commit
a25997bf65
@@ -159,7 +159,11 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
dispatchEvent(view, new TopShouldStartLoadWithRequestEvent(view.getId(), url));
|
||||
dispatchEvent(
|
||||
view,
|
||||
new TopShouldStartLoadWithRequestEvent(
|
||||
view.getId(),
|
||||
createWebViewEvent(view, url)));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -167,8 +171,8 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
dispatchEvent(view, new TopShouldStartLoadWithRequestEvent(view.getId(), request.getUrl().toString()));
|
||||
return true;
|
||||
final String url = request.getUrl().toString();
|
||||
return this.shouldOverrideUrlLoading(view, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user