next-query-params icon indicating copy to clipboard operation
next-query-params copied to clipboard

Option to not persist hash

Open penx opened this issue 1 year ago • 0 comments

Thanks for creating and maintaining this library!

Is your feature request related to a problem? Please describe.

When the hash relates to an element id on the page (often the intended purpose of using a hash), the viewport jumps to that element whenever the search params change.

The search params are controlled via a toolbar at the top of the page. If a user has previously visited a hash location within the document, I don't want to refocus it whenever a user interacts with the toolbar.

Describe the solution you'd like

An option to not persist the hash when search params change.

Personally I would expect this by default but understand others expect the opposite, and a change to default behaviour would be a breaking change, so a configurable opt-in would probably be best.

This is probably only an issue when you're using hashes that are ids of elements within the page.

Additional context

Related

penx avatar Jan 19 '24 17:01 penx