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.

Chrome (Windows) has weird scroll-jump behaviour?

See original GitHub issue

Incorrect Behaviour

When a page has lots of elements with the data-clipboard-text set, clicking one of these elements causes the page scroll to jump downwards. At the top of the webpage, if you click an element, there is no jump at all. The further down the page you are, the larger the scroll-jump is when you click an element.

Minimal example

https://jsfiddle.net/65gjsbok/ To see the effect in action, use Chrome on Windows, and scroll about half-way down the page of emojis, then click an emoji. On my computer, the page scoll instantly jumps downwards to near the bottom of the page.

Expected behaviour

I’d expect that the page scroll should not “jump” when clicking an element with data-clipboard-text.

Browsers affected

I tested on Chrome (Android), Chrome (Windows) and Mozilla (Windows). It appears that it only affects Chrome (Windows).

Other notes

This here is a modified fiddle which packs all the emojis up as high as possible, but has a “filler” div which enables the page to be very long still. It shows that this problem is dependant on the current scroll position. If you scroll down a bit, then click an icon, you’ll see a very small jump.

Hopefully this is just something silly that I’m doing! But it’s weird that it’s only happening on Chrome on Windows.

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
halbstarcommented, Jun 14, 2016

Sorry to disappoint you, but I had 2 nightmarish days, until I’ve found this issue (last thing that I’ve expected was problem with module 😃 Problem was in Safari, and Firefox, but, funny, not in Chrome…

We have a (jquery) context menu (right click), where some id or password is hidden and user should copy it. When you click on context menu, page jumps to the top…

I tried to upgrade, but it didn’t help… So I removed the line:

// Move element to the same position vertically this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';

and jumping stopped

I’m in a bit of a hurry now, so I don’t have time to think about consequences, but do we really need that line?

1reaction
zenorochacommented, Jun 9, 2016

Got it. Problem identified and fixed at v1.5.11.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome's inconsistent mouse scroll wheel behavior is driving ...
At one point, the scroll wheel will scroll regularly, the next moment, each click of the scroll wheel moves the page double what...
Read more >
Chrome exhibits weird scrolling jumping with anchor in the URL
Actual behavior: The page jumps back to the original scroll location and the click goes away. Even though the location bar text is...
Read more >
jumpy scrolling with mouse wheel on chorme (Windows) [closed]
Try scroll-behaviour rather than scrolling-behaviour . Docs for scroll-behavior. It's probably not possible to advise much more without a ...
Read more >
How to Fix Mouse Scroll Wheel Jumping in Windows 10 ...
Method 2: Re configuring Your Mouse Settings. One of the reasons why the mouse scroll is jumping up and down is because the...
Read more >
Erratic scroll wheel behavior/mouse behavior in Windows 10
I noticed the issue after Chrome updated itself, so I strongly suspect the bug may be due to recent changes in Chrome. There...
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