-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Chrome (Windows) has weird scroll-jump behaviour? #250
Comments
I'm testing on Chrome (Mac) and all seems to work fine. Just in case you would want to know. |
Thanks for that 👍 hopefully someone else can give Windows a shot to see if it's just something very weird going on with my computer. |
(bump) Anyone with Chrome on windows getting this behaviour in the above fiddles? |
I am getting the jump behaviour on Safari on this page when clicking Copy Link: https://www.sarahlawrence.edu/news-events/events/?filter-month=2016-06 The top few seem to be OK, but once you scroll down a little and click, it jumps you to the bottom of the page. |
Hmm... Do you get the jumping behaviour in the minimal example fiddle I posted? I'm not getting the jumping behavior in the link you posted with Chrome/Windows |
I see it in the fiddle in Safari, but not with Chrome. I'm on a fully-updated Mac. |
Cheers. Does this library support safari? I didn't think it did. Strange new development for me (again, Chrome/Windows): It's happening somewhat randomly. Like every 10th click or something (not when clicking the same element though). Right now, if I go to the fiddle, then scroll down to about half way, I need to click on ten or so emojis until the jumping occurs. Could you test Chrome with 10 or so clicks @thugsb? Maybe my Chrome updated recently, but I'm pretty sure that's not the case. Really unusual. Hopefully someone with some knowledge of the inner workings of this lib can comment on this. |
I can't get it to jump on my Chrome/Mac, event after 30 clicks, and in various amounts scrolled down the page. This library doesn't support the full copy-to-clipboard in Safari, but it does select the correct text so people can ctrl-c it. I've decided to remove the code for Safari, so that the buttons don't event appear. |
Sorry @josephrocca, I wasn't able to reproduce this problem. It seems like this bug should be reported to Chrome since it's related to a single operation system. Thanks for reporting! |
As noted above, I experience this same jumping behavior on Safari, but I somewhat expect that given the lack of Safari support. |
@manovotny I would still expect it to behave nicely in Safari. Curerently I'm using the error callback (thrown when using safari) to initiate a manual copy/paste from a text input. @zenorocha Looks like the problem occurs across multiple browsers. Could it be a bug introduced in a recent release? Seems very unlikely that this would have gone unnoticed by everyone until now. |
@josephrocca looks like what you're saying is a separate issue from the one that was created here. Please share a JSFiddle with a minimal example that reproduce such error. |
I think there's some misunderstanding here. The issue is that there is weird jumping behaviour on this minimal example: https://jsfiddle.net/65gjsbok/ (same one posted originally) I happens on Chrome/Windows for me (when I scroll down half way and then start clicking items randomly), and others have found somewhat similar behaviour on Safari. |
Got it. Problem identified and fixed at |
Thanks for your work on this great lib! 👍 |
🎉 🎉 🎉 🎉 🎉 🎉 |
Sorry to disappoint you, We have a (jquery) context menu (right click), where some id or password is hidden and user should copy it. I tried to upgrade, but it didn't help... So I removed the line:
and jumping stopped I'm in a bit of a hurry now, so I don't have time to think about consequences, |
Yes, that line is necessary @halbstar. Please make sure you're using the latest clipboard.js version and share a minimal JSFiddle that reproduces this error. |
Ok, back again with the new solution. First to say something about a problem: Thats why its good to have third position check, like in my case, position where event fired so now I changed line 467: into this: and this finally works in all tested situations, in my environment, but I'm really not sure is this good universal solution. But definitely, problem is there, and this is just a suggestion to think about it... Sorry again for not delivering fiddle example, but as I said, environment that I'm working on is very complex, there is a lot of libraries involved, Thanks... EDIT: |
Ok @halbstar, thanks for sharing your findings. Unfortunately I can't accept this fix since there's no way to reproduce it yet but we'll be waiting for a JSFiddle :) |
Hi, sorry to barge in on a closed issue, but we encountered similar behaviour in the horizontal direction. Here's an example (tested in Chrome 54 & FF 50): https://jsfiddle.net/hoh4w5g6/1/ Scroll to the right and click a button. Text is copied, but the scroll jumps to the left. Setting fake textarea position to pageXOffset fixes the scroll problem, but then, of course, the area is visible. Changing its display to none or visibility to hidden breaks the copy, so the only hack that worked was calling removeFake() immediately after copyText(), which doesn't look like a satisfactory solution. |
Have same issue: Iframe environment + scroll to top on click of copy-button. |
Also, got scrolling to the left side of window on copy. Like in this issue: #347
Gist with hotfix: https://gist.github.com/nskazki/03f8ddbdf53ec8cada3d4d873dd9fd79 |
Ok i did it, got valid reproducing example! Windows 10, Chrome..
Hope this helps! Thanks for your work. |
This should be fixed on |
…a#194 zenorocha#250" This reverts commit eb00fe4.
I still have it on version 2.0.11 |
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!
The text was updated successfully, but these errors were encountered: