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:

  1. user clicks
  2. section unfolds as expected
  3. [probably] enhanced navigation detects a url change (even though it’s behind the # which shouldn’t concern it)
  4. [almost certainly] enhanced navigation triggers a page visit (on the existing page)
  5. browser does a fetch request
  6. page gets reset to show the section collapsed again

Here’s a gif-video showing the behavior:

oqtane-issue-accordion

And here a print-screen of the fetch operation which shouldn’t have happened:

image

  1. was the original page F5
  2. secret unwanted fetch
  3. another unwanted fetch

Expected Behavior

  1. Any link which doesn’t change the real url should not trigger the enhanced navigation - especially if it just modifies the # parameter.
  2. …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)

Most upvoted comments

@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?