-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Issue with umb-route-slot
inside routed modal
#16834
Comments
Hi there @enkelmedia! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Hi @enkelmedia Good case, we do this our selfs, for example Workspaces has their own router-slot. I've also done some work on this lately as we implemented conditions for Block Workspace Views. As we only want to see the Settings View if a Block has Settings etc. Otherwise I would be cautious about your redirects in the modal (also notice you have a test-redirect which might mess it up). Also I'm not sure there is any reason to first set your routes in the connectedCallback, should be fine to have them set up-front :-) let me know how that goes, also if you have any ideas on how the DX could be improved :-) |
Hi! Thanks for looking a this! Valid point, I did try to put the routes in the ctor as well, no difference and then I forgot to move them back. I also found something that seems to solve the problem, basically adding the code below to the end of the const newActiveLocalPath = this._constructLocalRouterPath();
if (this._activeLocalPath !== newActiveLocalPath) {
this.#router.routes = [...this.#router.routes];
} Not sure at all if this is a robust solution (or if it creates other issues) but there is a PR for it here: umbraco/Umbraco.CMS.Backoffice#2146 What do you think about this approach? Btw. thanks for pointing out about the redirects, it seems like appending the full url to the route inside the modal make for a snappier load: I could try out the upcoming 14.2 to see if there is anything different, I did spend about 8 hours trying to get this to work but then falled back to making the stuff in the modal a |
fixed by umbraco/Umbraco.CMS.Backoffice#2146 |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
14.1.1
Bug summary
I have a couple of places where I would like to have a
umb-route-slot
inside a routed modal. I've managed to get it to "kind of work" but there is something strange going on in some scenarios which causes theumb-router-slot
inside my modal to not load.Specifics
I have a branch from the backoffice-repo here with a example:
https://github.com/enkelmedia/Umbraco.CMS.Backoffice/tree/routed-modal-issue/examples/modal-routed
In summary I have a dashboard which contains a
umb-router-slot
(tab1 and tab2), tab2 of the routes inside contains aUmbModalRouteRegistrationController
that hosts a modal. This modal also contains aumb-router-slot
. The problem is that the route inside the modal is only loaded when the modal is opened from tab2, not if I navigate to the route from another location in the backoffice.I hope that this can illustrate the issue:
After fiddling with this for quite some time I'm starting to wonder if this is a bug or if I'm missing something.
Steps to reproduce
Have a look at the sample:
https://github.com/enkelmedia/Umbraco.CMS.Backoffice/tree/routed-modal-issue/examples/modal-routed
npm run example # pick `modal-routed`.
Expected result / actual result
Since the route works from the tab2-view it should also be possible to navigate to it using a a-href.
The text was updated successfully, but these errors were encountered: