Skip to content

Was NavigationLock designed for mobile devices and back to previous page? #48610

Answered by MackinnonBuck
hariywill asked this question in Q&A
Discussion options

You must be logged in to vote

@hariywill, how is your NavigationLock configured? Does it only specify ConfirmExternalNavigation="true"? If so, note that this will only cause an alert to display for external navigations, i.e., navigations that require a full page reload. If you want to display an alert for navigations that get handled by Blazor's client-side navigation, you can specify an OnBeforeInternalNavigation callback and use it to display a confirmation prompt via JS interop. You'll have to provide both NavigationLock parameters if you want to handle both cases.

For the iPad-specific issue, it looks like you might be experiencing https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-th…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hariywill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-blazor Includes: Blazor, Razor Components
3 participants