Skip to content

Support Blazor Android WebView Back Navigation #4364

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

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

TanayParikh
Copy link
Contributor

Currently, hitting the Android Back button within a WebView will take you back to the main page of the app regardless of how 'deep' you've navigated within the WebView. This change will allow navigation within the WebView stack before returning to the main page of the app.

Fixes: #3385

@TanayParikh TanayParikh added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Jan 28, 2022
@TanayParikh TanayParikh requested a review from a team January 28, 2022 01:16
@TanayParikh TanayParikh requested a review from Eilon as a code owner January 28, 2022 01:16
Comment on lines +16 to +21
if (keyCode == Keycode.Back && CanGoBack() && e?.RepeatCount == 0)
{
GoBack();
return true;
}
return false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to ensure the WebView captures the Android back button press before ceding control to the host app.

@TanayParikh TanayParikh merged commit 898af55 into main Jan 28, 2022
@TanayParikh TanayParikh deleted the taparik/fixBlazorAndroidWebViewBackButton branch January 28, 2022 17:51
@TanayParikh TanayParikh self-assigned this Jan 29, 2022
@mkArtakMSFT mkArtakMSFT added this to the 6.0.300-preview.14 milestone Mar 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
@samhouts samhouts added the fixed-in-6.0.200-preview.13.2 Look for this fix in 6.0.200-preview.13.2! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView fixed-in-6.0.200-preview.13.2 Look for this fix in 6.0.200-preview.13.2!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] BlazorWebView Issue if href to external site is clicked - can't return to app
4 participants