Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/src/Platform/iOS/MauiWKWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public override void MovedToWindow()
_movedToWindow?.Invoke(this, EventArgs.Empty);
}

[Export("webView:didFinishNavigation:")]
[Obsolete("Use MauiWebViewNavigationDelegate.DidFinishNavigation instead.")]
public async void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
{
var url = CurrentUrl;
Expand Down
8 changes: 6 additions & 2 deletions src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MauiWebViewNavigationDelegate(IWebViewHandler handler)
}

[Export("webView:didFinishNavigation:")]
public void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
public async void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
{
var handler = Handler;
var virtualView = handler?.VirtualView;
Expand All @@ -43,7 +43,11 @@ public void DidFinishNavigation(WKWebView webView, WKNavigation navigation)

virtualView.Navigated(_lastEvent, url, WebNavigationResult.Success);

handler.PlatformView?.UpdateCanGoBackForward(virtualView);
// ProcessNavigatedAsync calls UpdateCanGoBackForward
if (handler is WebViewHandler webViewHandler)
await webViewHandler.ProcessNavigatedAsync(url);
else
handler.PlatformView?.UpdateCanGoBackForward(virtualView);
}

[Export("webView:didFailNavigation:withError:")]
Expand Down