Skip to content

Allow cancellation of navigation with bUnits NavigationManager #804

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

Closed
linkdotnet opened this issue Jul 24, 2022 · 0 comments · Fixed by #809
Closed

Allow cancellation of navigation with bUnits NavigationManager #804

linkdotnet opened this issue Jul 24, 2022 · 0 comments · Fixed by #809
Labels
enhancement New feature or request

Comments

@linkdotnet
Copy link
Collaborator

With the recent merge of this PR: dotnet/aspnetcore#42638 (here the issue which tracks the topic: dotnet/aspnetcore#42877) users can intercept the NavigationManager and prevent redirects. To make it work we have to add some logic in the NavigateToCore function.

Here is an inspiration how it is done in the PR for the RemoteNavigationManager: https://github.com/dotnet/aspnetcore/blob/d1558107b97d2471e9a0aa5d008b511ead908fa7/src/Components/Server/src/Circuits/RemoteNavigationManager.cs#L84

Goal

The user should have means to simulate the cancellation behaviour in a bUnit test. That said if he has a NavigationLock component which would prevent the navigation, we should have the same behaviour in bUnit. That includes also no new item on the NavigationHistory stack. No change of BaseUri or Uri.

Analysis

I tried to use the feature as it is already merged to main, but unfortunately the nightly builds don't include this function at the moment.

@linkdotnet linkdotnet added the input needed When an issue requires input or suggestions label Jul 24, 2022
@linkdotnet linkdotnet added enhancement New feature or request and removed input needed When an issue requires input or suggestions labels Aug 5, 2022
@egil egil closed this as completed in #809 Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant