oqtane.framework: [BUG] Changes in Hash of URL through JS Broken because of enhanced navigation
Oqtane Info
Version - 5.1.2 Render Mode - Static Interactivity - Server Database - SQL Server
Describe the bug
We have an application showing a bootstrap accordion to open/close certain sections.
The mechanism also adds a #sectionName to the url, so that anybody sharing the link would end up opening/closing the same section when they revisit the page.
In Oqtane - at least SSR - this results in random behavior. This is what happens:
- user clicks
- section unfolds as expected
- [probably] enhanced navigation detects a url change (even though it’s behind the
#which shouldn’t concern it) - [almost certainly] enhanced navigation triggers a page visit (on the existing page)
- browser does a fetch request
- page gets reset to show the section collapsed again
Here’s a gif-video showing the behavior:
And here a print-screen of the fetch operation which shouldn’t have happened:
- was the original page F5
- secret unwanted fetch
- another unwanted fetch
Expected Behavior
- Any link which doesn’t change the real url should not trigger the enhanced navigation - especially if it just modifies the
#parameter. - …unless really wanted - e.g. if a script explicitly wants to reload the page (not sure how this is done, but it would be more than just a link)
Steps To Reproduce
A bit tricky, but basically create a bootstrap accordion on a page and try to use it.
Anything else?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (18 by maintainers)
@iJungleboy your minimal repro has nothing to do with Bootstrap Accordions - it has to do with fragment/anchor processing on Urls - should I change the title of this issue to reflect the actual issue?