This repository was archived by the owner on Feb 1, 2026. It is now read-only.
fix: initialize progress value with init scroll#288
Open
alvarosabu wants to merge 1 commit into
Open
Conversation
|
|
✅ Deploy Preview for cientos-tresjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
JaimeTorrealba
suggested changes
Nov 21, 2023
| watch(windowY, (value) => { | ||
| if (!isScrolling.value && !props.htmlScroll) return | ||
| function updateScroll(value: number) { | ||
| progressScroll.value = (value / height.value / (scrollNodeY.value / height.value - 1)) |
Member
There was a problem hiding this comment.
How is this working for horizontal axis??
andretchen0
approved these changes
Dec 4, 2023
Contributor
andretchen0
left a comment
There was a problem hiding this comment.
It works! This is a welcome improvement.
I'm approving since the fix works, but I noticed this related bug.
Bug: linking to named anchors
Reproduction
Example markup
<a href="#two">Jump to section 2</a>
<section><h1>Section 1</h1></section>
<section><h2 id="#two">Section 2</h2></section>
- In the text editor, insert the example markup into the playground/src/pages/controls/ScrollControlsDemo.vue and save.
- On the command line, start the playground with
pnpm run playgroundif not already running. - In the browser, open a new, blank tab.
- In the browser, paste
http://localhost:5173/controls/scroll-controls#twoin the address bar and hitEnter.
Expected behavior
The page should scroll to the second header.
Behavior
The page loads and remains at y-offset 0.
Once the page is loaded, clicking on "Jump to section 2" works as expected.
Tested in Chrome, FF, Safari on Mac.
Would you like this to be opened as a separate issue or worked on here?
Member
Author
|
Hi @andretchen0 thanks for the help, yes let's open it on a separate issue to focus on anchors |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue with the progress value being always 0 even if the page is refreshed after scrolling to a certain position. (Astro)