question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page scrolls down on load

See original GitHub issue

Describe the bug

When the page loads, the window scrolls down to the first element. This means that the margin-top applied above the first element is skipped over.

Reproduction

https://github.com/ezfe/scroll-issue-reproduction

Use npm run dev and open the page. The text will appear at the top of the screen, with the margin-top scrolled up above the top of the screen.

Appears to only happen in Safari.

Logs

[Log] [vite] connecting... (client, line 184)
[Log] [vite] connected. (client, line 211)

System Info

z
  System:
    OS: macOS 12.3
    CPU: (8) arm64 Apple M1
    Memory: 111.86 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.4.0 - /opt/homebrew/bin/node
    npm: 8.3.2 - /opt/homebrew/bin/npm
  Browsers:
    Edge: 98.0.1108.56
    Firefox: 98.0
    Safari: 15.4
  npmPackages:
    @sveltejs/adapter-static: next => 1.0.0-next.28 
    @sveltejs/kit: next => 1.0.0-next.278 
    svelte: ^3.44.0 => 3.46.4

Severity

annoyance

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
timothycohencommented, May 5, 2022

Ahh, yes, that was me in the discord. I was able to create a fail/pass test only by adding webkit to the Playwright config, and doing so exposed 13 other failing tests. Not sure how the core team wants to handle that, but I’m going to take a look at the other failing webkit enabled tests.

0reactions
ZerdoX-xcommented, Jul 19, 2022

I have the same issue when loading sumsub’s widget in iframe… Not sure how to reproduce it 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is causing this web page to scroll down when it loads?
When I load the page, it scrolls down to a specific div. I already spent 2 hours trying to find out which code...
Read more >
Auto Scroll Down on Page Load Using jQuery - Medium
To Auto Scroll Down on Page Load using jQuery, we use $( document ).ready() that helps us to check the page Document Object...
Read more >
Why does my web-page keep scrolling down by itself ... - Quora
You may have a mouse that automatically scrolls when the scroll wheel is clicked. Trying clicking on the mouse wheel to stop this...
Read more >
Page scrolls down on load? - General - Forum | Webflow
Hi, when I load the page https://nl.cro.cafe/, it automatically scrolls down to a section showing images of people which is almost at the...
Read more >
Team Site Scroll down middle of the page on load
Scrolling doesn't apply for whole page, instead it applies to specific div. While other sites don't have similar scenario and they works with ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found