Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Add <a href='...' sapper-noscroll> #376

Closed
Rich-Harris opened this issue Aug 24, 2018 · 3 comments
Closed

Add <a href='...' sapper-noscroll> #376

Rich-Harris opened this issue Aug 24, 2018 · 3 comments

Comments

@Rich-Harris
Copy link
Member

Occasionally you want a link to take you to a new route without affecting the scroll position (e.g. you're flicking through some horizontal tabs that have been pushed down by a header). Currently it requires some hoop-jumping.

It would be cool if you could just do this instead:

<a href="foo" sapper-noscroll>
  clicking this link won't reset the scroll position to zero
</a>
@arggh
Copy link

arggh commented Aug 28, 2018

I just implemented a quick ad-hoc work-around, but it's annoyingly janky, since I have to persist the scroll position and the resume it every time the route changes. Maybe there's a better way to overcome the jank, but nevertheless this feature would be much appreciated!

Rich-Harris added a commit that referenced this issue Oct 6, 2018
@Rich-Harris
Copy link
Member Author

This is implemented in 0.22.10

@elcobvg
Copy link
Contributor

elcobvg commented Oct 6, 2018

Just what I was looking for, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants