Skip to content
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

Fixes with umb-route-slot inside routed modal #2146

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

enkelmedia
Copy link
Contributor

Description

This provides a potential fix for the issue described here: umbraco/Umbraco-CMS#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.

umb-issue-routes-fix

Types of changes

  • 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

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@nielslyngsoe
Copy link
Member

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.

Copy link

sonarcloud bot commented Aug 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants