vue2-scrollspy icon indicating copy to clipboard operation
vue2-scrollspy copied to clipboard

Option to stop clicking on links from updating the hash in the location bar

Open PawelDecowski opened this issue 5 years ago • 3 comments

Describe what you want:

In a project I’m working on, I don’t want the navigation clicks to change the URL. Eg:

URL:

https://example.com/

Navigation link:

<a href="#about">About</a>

After clicking, the viewport is scrolled to the #about anchor but the URL remains https://example.com/ (hash is not updated/added).

It could be an option on v-scroll-spy-link:

<ul v-scroll-spy-link="{updateHash: false}">

PawelDecowski avatar Mar 16 '19 15:03 PawelDecowski

I know it's late but I'm fairly certain you don't even need to put an href, so if you remove it, it should still work.

devotoare avatar Oct 25 '19 16:10 devotoare

@devotoare You’re correct. By removing href the behaviour is as expected. I’m probably missing something but how does it know where to scroll to without the href?

PawelDecowski avatar Nov 05 '19 17:11 PawelDecowski

@PawelDecowski Honestly not sure, haven't looked at the code very closely. Just figured I could answer the basic question since I tried it. Sorry

devotoare avatar Nov 06 '19 03:11 devotoare