Umbraco.CMS.Backoffice
Umbraco.CMS.Backoffice copied to clipboard
Fixes with `umb-route-slot` inside routed modal
Description
This provides a potential fix for the issue described here: https://github.com/umbraco/Umbraco-CMS/issues/16834
I'm thinking that the problem might be that the event that is fired when the route changes fires before the umb-route-slot inside the modal has been loaded. I tried some hacks with setTimeout to trigger the "routes"-attribute to re-load the routes in the modal. This worked so i figured that maybe if we set the routes of the underlying router-slot when a new route is loaded it might solve the problem.
I made a small change to the firstUpdated method of UmbRouterSlotElement and after this, the scenario that I was having trouble with works.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)
Motivation and context
How to test?
I've also added a example-folder to the PR, so just run
npm run example
And pick modal routed
Checklist
- [x] If my change requires a change to the documentation, I have updated the documentation in this pull request.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
Hi @enkelmedia
I had a look at this one, there is clearly a problem. I did not manage to boil it down just jet.
But its clear that the modal does not act correct.
For starters it should go away when navigating browser history.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code