Skip to content

Hash not removed when all accordions closed #6

@jeremy-farrance

Description

@jeremy-farrance

I put an Accordion at the top of the page with two expandos; Introduction and Reminders. Both default to not expanded. When you expand either, the hash is added to the URL... e.g. /pagepath#4461

Below this I have a few dozen rows of data that gets edited in the normal 2sxc way. The problem is when you edit one of your content items and save, the page refresh and - using the #hash - reopens the accordion and scrolls the page up and down to a different location than where you were editing.

Even with both accordion items closed, anything triggering a refresh causes the page to get hijacked and you can't stop it and its very confusing to the user. Normally after an edit/save, you expect the page to just update the data you changed so you get reassuring confirmation that your edits were made and saved.

Anyhow, is this something that needs to be fixed? Or is there a workaround? Or have I missed some setting or some part of the setup?

It seems like the accordion's JS should not only add the #hash, but also remove it. But it does not. So any page refresh causes unwanted scrolling and repositioning as well as an unexpected accordion item to reopen even though they were all left closed.

I made a GIF demo here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions