-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Trigger LocationChanging callbacks on enhanced navigation #48766
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
Comments
…eractive components when using SSR routing (#51279) # Invoke `LocationChanged` for interactive components when an enhanced navigation occurs This PR makes the `LocationChanged` event get invoked for interactive runtimes when an enhanced navigation occurs. ## Description This PR makes the following changes: * The `LocationChanged` event gets invoked for all interactive runtimes when either a client-side or enhanced navigation occurs * Previously: * An enhanced navigation would have not invoked the `LocationChanged` event in interactive runtimes * A client-side navigation would only invoke the `LocationChanged` event for the runtime that started most recently * Attempting to enable interactive routing from multiple interactive runtimes results in an error at runtime * If an interactive router is present but multiple runtimes are available, the `LocationChanging` event only gets invoked for the runtime that has the interactive router * It would take additional work to allow either runtime to cancel a client-side navigation, and that's outside the scope of this PR. We have #48766 to track doing the extra work to support this scenario Fixes #51216 ## Customer Impact Without this changes the customers will encounter problems with UI being correctly updated during enhanced navigation because `LocationChanging` event not firing. Besides the UI not updating correctly this will also cause customer registered handlers for the `LocationChanged` event not firing resulting in unexpected behaviors. ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low Despite the size of this change, we have quite extensive automated tests (including these newly added ones) around the interactive routing scenarios, so we expect that nothing will break from this change. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [x] No - [ ] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props --------- Co-authored-by: Surayya Huseyn Zada <[email protected]> Co-authored-by: Surayya Huseyn Zada <[email protected]>
Thanks for contacting us. We're moving this issue to the |
…eractive components when using SSR routing (#51279) # Invoke `LocationChanged` for interactive components when an enhanced navigation occurs This PR makes the `LocationChanged` event get invoked for interactive runtimes when an enhanced navigation occurs. ## Description This PR makes the following changes: * The `LocationChanged` event gets invoked for all interactive runtimes when either a client-side or enhanced navigation occurs * Previously: * An enhanced navigation would have not invoked the `LocationChanged` event in interactive runtimes * A client-side navigation would only invoke the `LocationChanged` event for the runtime that started most recently * Attempting to enable interactive routing from multiple interactive runtimes results in an error at runtime * If an interactive router is present but multiple runtimes are available, the `LocationChanging` event only gets invoked for the runtime that has the interactive router * It would take additional work to allow either runtime to cancel a client-side navigation, and that's outside the scope of this PR. We have dotnet/aspnetcore#48766 to track doing the extra work to support this scenario Fixes #51216 ## Customer Impact Without this changes the customers will encounter problems with UI being correctly updated during enhanced navigation because `LocationChanging` event not firing. Besides the UI not updating correctly this will also cause customer registered handlers for the `LocationChanged` event not firing resulting in unexpected behaviors. ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low Despite the size of this change, we have quite extensive automated tests (including these newly added ones) around the interactive routing scenarios, so we expect that nothing will break from this change. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [x] No - [ ] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props --------- Co-authored-by: Surayya Huseyn Zada <[email protected]> Co-authored-by: Surayya Huseyn Zada <[email protected]>
Location changing handlers may not always be invoked on enhanced navigation. For example, when no interactive router is present, interactive components cannot intercept user-initiated navigations.
From @MackinnonBuck:
A more detailed analysis of when location changing handlers get invoked can be found here.
The text was updated successfully, but these errors were encountered: