Was NavigationLock designed for mobile devices and back to previous page? #48610
-
I tried NavigationLock in one of my project. On PC, I am not getting alerts when I click back to previous page button. On iPad, I am not getting alert box at all no matter it's refreshing page or type in new url. Are these intended by design or bugs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@MackinnonBuck please have a look here (I saw you were involved in that feature, so I hope you're the right person to ask) |
Beta Was this translation helpful? Give feedback.
-
@hariywill, how is your For the iPad-specific issue, it looks like you might be experiencing https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-the-ipad. Behind the scenes, |
Beta Was this translation helpful? Give feedback.
@hariywill, how is your
NavigationLock
configured? Does it only specifyConfirmExternalNavigation="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 anOnBeforeInternalNavigation
callback and use it to display a confirmation prompt via JS interop. You'll have to provide bothNavigationLock
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…