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
x/website: Content scrolls up when text is selected #52917
Comments
I can not reproduce this issue. It looks like there is an extension which changes the behavior of the double click. Can you disable all the extensions and try again? |
I disabled all the extensions but I can still see the issue. I could even reproduce it on Firefox and Chrome across several Windows versions using browserling. Here's a gif that shows the bug: https://imgur.com/a/76BN8iG |
Thank you for providing the information. Since you observed the same behavior across different browsers, I guess that the scroll event (or other events that causes the page to scroll up) is emitted by your system. Maybe the mouse is broken, maybe there is an application capturing the double click events and emitting other events. Can you try two more things to confirm the root cause of the issue?
If you know how to use Spy++, you can use it to check what messages are emitted. It's shipped with Visual Studio. If you don't want to install Visual Studio, you can download it from https://github.com/westoncampbell/SpyPlusPlus. Here is my message options: And here is the messages captured on my computer: |
Looks like this doesn't happen if you use a mouse. It only happens if you use laptop touchpads (I verified this on 2 separate laptops, both on Windows), and to a certain extent, touch devices. I could reproduce this issue on an iPhone 13 as well, on both Chrome and Safari. |
OK, I have managed to reproduce the described behavior.
If this is your case, then I think the behavior is expected and there is nothing wrong. |
I'm not sure how this is expected behavior. Double tap on a touchpad should select the text, not scroll it up automatically. The Go docs website is the only website where this happens. All other websites select text when double tapped with a touchpad. |
If you move your finger unintentionally on the second tap, the double tap will be recognized as |
Nope. The issue happens without moving your finger at all, with a simple double tap on a word. |
Can you use Spy++ to capture the messages as suggested in #52917 (comment)? |
Since this issue is not specific to the golang documentation website, and it's more like a browser, system or hardware issue, maybe we should avoid discussing it here so that we won't make too many noises. I still incline to the guess that the behavior is a "select and drag outside of the viewport". If you still want to diagnose this issue, please find me on slack. And if we find something, we can report back here. Thank you! |
How do I find you on slack? |
@a3y3 is right, I can reproduce this as well. @ZekeLu please make sure to position the text exactly as on the GIF. The problem is in _content/css/styles.css on line 250 |
I can create a CL for this, but I asked the original author of this line about his intent. It was almost 2 years ago, probably he won’t recall the reason behind the line, but let’s wait and see |
@looshch Excellent! I don't have a touchpad right now. But when I set The value is set in this commit: golang/website@5571d04. But there is not information about why it's set. I think it's safe to remove it. Update |
Change https://go.dev/cl/409014 mentions this issue: |
I’m glad it could be reproduced! As you can imagine, it can get annoying because some people like to read by double tapping on text and selecting it as they read along - and that’s not possible because of the scrolling issue. I do wonder why the content scrolls up only on touchpad and not a mouse, though. |
This was probably added with the sticky header to make anchor links snap their scroll position below the header content. We removed the sticky header at some point so this scroll fix is no longer necessary. Thanks for the investigation and fix! |
What is the URL of the page with the issue?
Every page on go doc, but I'll refer to https://go.dev/doc/tutorial/workspaces in the examples below.
What is your user agent?
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Screenshot
What did you do?
What did you expect to see?
The text should get selected/highlighted.
What did you see instead?
The page scrolls up quickly, creating a very uncomfortable user experience.
The text was updated successfully, but these errors were encountered: