[✨] Remember the scroll position forward and not just backward #288
Replies: 8 comments
-
please help to check link |
Beta Was this translation helpful? Give feedback.
-
https://qwikstarterwvympk-skus--5173--71ef666c.local-credentialless.webcontainer.io/link-scroll |
Beta Was this translation helpful? Give feedback.
-
@JerryWu1234 Link updated in the original post. Apologies, I'm not too familiar with Stackblitz |
Beta Was this translation helpful? Give feedback.
-
I can only see that in your stackblitz @williamsdyyz |
Beta Was this translation helpful? Give feedback.
-
Append /link-scroll to the address in the preview pane. The share link I created already had that. But I guess not. ¯_(ツ)_/¯ |
Beta Was this translation helpful? Give feedback.
-
thanks @williamsdyyz So the purpose of the For navigating normally, it doesn't remember the scroll positions, only for going back in history. Maybe this should be documented better? |
Beta Was this translation helpful? Give feedback.
-
@shairez Interesting. False assumption on my part. That prop is not documented at all. In that case, the issue changes somewhat. For the use-case of showing a modal dialog that can be closed with the back button (similar to Android UX), there is no way to stop the navigation to the dialog from scrolling the underlying document to top. I've added an example to the link-scroll page: scroll down, click "Open dialog". The dialog appears but the document scrolls to top which is undesirable. The back button nicely closes the dialog and the scroll position is restored to where it should ideally have been all along. I guess this is really a feature request, not a bug. Is there any existing way to achieve what I need? |
Beta Was this translation helpful? Give feedback.
-
We moved this issue to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Which component is affected?
Qwik Runtime
Describe the bug
I'm trying to show dialog boxes based on a search param like
<Link href="./?dialog=about" scroll={false}>About us</Link>
I need the scroll position of the document to stay put when the user clicks the link. Unfortunately scroll={false} isn't doing that.
Reproduction
https://stackblitz.com/edit/qwik-starter-wvympk?file=src%2Froutes%2Flink-scroll%2Findex.tsx
Steps to reproduce
System Info
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions