Breadcrumb link disappears on CanDeactivate guard check #111
Replies: 6 comments 12 replies
-
@udayvunnam - Thanks for creating this wonderful library. Any suggestions to the question would be greatly appreciated.. |
Beta Was this translation helpful? Give feedback.
-
@nakash2050 I hope you can intercept the onClick with https://udayvunnam.github.io/xng-breadcrumb/#/intercept-breadcrumb-onclick?id=intercept-breadcrumb-onclick Please see if you can make use of this for preventing navigation. If this is something you wish to be the default behavior, please provide a minimal reproducible demo similar to https://stackblitz.com/edit/angular-xng-breadcrumbs |
Beta Was this translation helpful? Give feedback.
-
@udayvunnam - Thanks for your response. Please find the demo below Click on "To Page 2 Child" |
Beta Was this translation helpful? Give feedback.
-
@nakash2050 tracked in #113 |
Beta Was this translation helpful? Give feedback.
-
@udayvunnam - The feature is failing in another scenario i.e. when the route has a resolver. Breadcrumb loads before the resolver promise completes. Also, I saw you have added a new filter for GuardChecksEnd in the breadcrumb service. This is breaking the earlier guard check fix which was added. Now even if "cancel" button is clicked, the breadcrumb link disappears. Instead of the below - line 68 replace with NavigationEnd remove "&& event.shouldActivate" from line 76 This should resolve both GuardCheck and Resolver issues. |
Beta Was this translation helpful? Give feedback.
-
@nakash2050 @hugo-azevedo could you please provide replication of the issue. Here's a sample repo https://stackblitz.com/edit/angular-xng-breadcrumbs-bkzine @nakash2050 has created earlier. Please use the latest version of xng-breadcrumb in the demo |
Beta Was this translation helpful? Give feedback.
-
How does one prevent navigation to the clicked link (Home) when the CanDectivate guard check fails for a route? Currently when the "Home" link is clicked, the guard prevents the navigation based on the current route form check but the breadcrumb child links disappear and shows only the "Home" link as if there is no check.
Beta Was this translation helpful? Give feedback.
All reactions