Skip to content

NavigationLock with ConfirmExternalNavigations doesn't show confirm dialog when changing address bar after initial app load #43725

@danroth27

Description

@danroth27

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Using NavigationLock with ConfirmExternalNavigations doesn't show confirm dialog when changing address bar after the initial app load.

Expected Behavior

Confirm dialog is shown after changing the address bar even on first load.

Steps To Reproduce

  • Create a Blazor WebAssembly app
  • Add <NavigationLock ConfirmExternalNavigations /> to Index.razor
  • Run the app
  • After the app loads, change the address bar to a different external address

Exceptions (if any)

None. Browser console looks clean.

.NET Version

7.0.100-rc.1.22429.3

Anything else?

If you navigate internally, like to the Counter page first and then back to Home, then changing the address bar does trigger the confirm dialog.

External links, like an anchor tag pointing to blazor.net on the home page, also successfully get interrupted.

Repros with both Edge and Chrome.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions