Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollControls: external links to named anchors don't scroll the page #301

Open
5 tasks done
andretchen0 opened this issue Dec 5, 2023 · 0 comments
Open
5 tasks done
Assignees
Labels
bug Something isn't working

Comments

@andretchen0
Copy link
Contributor

andretchen0 commented Dec 5, 2023

Describe the bug

Following a link with a named anchor to a page including ScrollControls does not scroll the resulting page to the anchor.

E.g., where http://example.org is a page including ScrollControls, from a new tab, pasting http://example.org#features into the address bar and pressing Return will load the page, but the page will not be scrolled to the features anchor.

Behavior

On page load, the page is not scrolled to the named anchor. (offset y = 0)

Expected behavior

On page load, the page should be scrolled to the named anchor.

Reproduction

No StackBlitz provided. It doesn't appear that the bug is reproducible on StackBlitz' window-in-window setup.

Steps to reproduce

Example markup

<a href="#two">Jump to section 2</a>
<section><h1>Section 1</h1></section>
<section><h2 id="#two">Section 2</h2></section>
  1. In the text editor, insert the example markup into the playground/src/pages/controls/ScrollControlsDemo.vue and save.
  2. On the command line, start the playground with pnpm run playground if not already running.
  3. In the browser, open a new, blank tab.
  4. In the browser, paste http://localhost:5173/controls/scroll-controls#two in the address bar and hit Enter.

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Memory: 77.72 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.8.1 - /opt/homebrew/bin/node
    npm: 10.1.0 - /opt/homebrew/bin/npm
    pnpm: 8.6.5 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 119.0.6045.199
    Safari: 17.0
  npmPackages:
    @tresjs/core: 3.5.0 => 3.5.0 
    @tresjs/eslint-config-vue: ^0.2.1 => 0.2.1 
    vite: ^4.5.0 => 5.0.4 

Tested in Chrome, FF, Safari on Mac.

Used Package Manager

npm

Code of Conduct

Related: #288 (comment)

@alvarosabu alvarosabu added the bug Something isn't working label Dec 13, 2023 — with Volta.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants