-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Think through what should happen if all fragments in a visit already match the new URL #80
Comments
Yes, this was resolved. Take a look at https://filter-munich.com/calendar/ and click one of the items on the left multiple times. It will reload the fragment on the right, as that fragment already matches the current URL. CleanShot.2024-11-25.at.12.19.50-small.mp4 |
@hirasso Nice. How does it know to only reload the right-hand fragment, and not all of them? |
That's because the |
Ah, true! |
Thanks for reminding me to close this as completed :) |
Describe the problem 🧐
If all fragments in a visit already match
visit.to.url
, currently the matching fragment visit will simply be ignored, falling back to swups default containers for that visit.That is not what would be expected. That kind of situation is basically like a link to the current page, even though the
visit.from.url
is not equal tovisit.to.url
.Describe the propsed solution 😎
I've done a bit of research in #79 and then decided to first start with an issue.
I'm unsure about the ideal solution for the scenario described above. Maybe the behavior could be aligned with whatever is defined in
swup.options.linkToSelf
:linkToSelf
isscroll
, nothing should happen (matching fragment visit, emptycontainers
)linkToSelf
is set tonavigate
, the fragments should be reloaded (matching fragment visit with the containers of the matched rule)As mentioned above, I'm not absolutely sure about the perfect solution here. Happy to talk it all through together.
Alternatives considered 🤔
Add a hook and always remove the fragment URL from the fragment element:
How important is this feature to you? 🧭
Would make my life a lot easier
Checked all these? 📚
The text was updated successfully, but these errors were encountered: