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.

Main content scrolls when mouse is left of Navigation Sidebar

See original GitHub issue

Summary

When the page exceeds a width of 1460px the page elements will stop becoming wider, and there will be empty space added to the sides of the page instead. The empty space to the left side of the Navigation sidebar is not part of that sidebar, and will scroll the main content part of the page, instead of the navigation, even though it visually looks like it is part of the Navigation.

URL

https://developer.mozilla.org/en-US/docs/Web

Reproduction steps

  1. Have a window wider then 1460px or zoom out far enough (e.g. more then 730px with 50% zoom, etc.)
  2. Move the mouse pointer to the left of the Navigation side bar
  3. Use Scroll wheel to scroll down -> The Main Content will scroll instead of the Sidebar

Expected behavior

The sidebar does extend to the left edge of the screen at all times.

Actual behavior

The sidebar does not extend to the left edge of the screen at all times.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Windows

Screenshot

Current behaviour: mdn-scroll-current

Expected Behaviour: (for this example using the code listed below) mdn-scroll-better

Anything else?

the fix for this issue is very trivial; simply adding

.document-page .sidebar {
    margin-left: -800%;
    padding-left: 800%;
    width: 900%;
}

to the css would fix this issue already. (Technically it only makes the interactable boundary of the Navigation sidebar 9 times as wide, but if anyone zooms out far enough to have that much blank space to both sides i’d say they are to blame 😆)

I am in fact already using this fix through Tampermonkey and the following userscript: Gist: schockocraft/mdn-fix-sidebar-scroll.js

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
schockocraftcommented, Nov 5, 2022

Ok anyways i went on a stroll through the internet rn, with the following results:


do not have a max width for the content, so there’s never empty space to the left of the sidebar or to the side of the content


keep the sidebar at the left edge at all times, with the added padding on high page widths separating content from sidebar


do not allow the sidebar to scroll separately


Have the same problem


StackOverflow & co have the same problem, but only at high zoom levels as on a normal screen sizes the sidebar will never be long enough to need to be scrolled.

readthedocs.io aligns the whole page content to the left.

Then there are also some documentations that don’t use sidebars at all like manpages or the JSDoc documenation

0reactions
caugnercommented, Nov 11, 2022

@schockocraft Thank you so much for the thorough research. 👍

After looking at the examples, and testing the scroll behavior on a few MDN pages, however, I come to the conclusion that it is working as intended. The empty space outside of the sidebars is not part of the sidebar, so it is normal that scrolling there scrolls the main content, not the sidebar. It’s also more likely that the user wants to scroll the main content rather than the sidebar.

I’m going to close this issue as “won’t fix”, but thanks for bringing this potential UX issue to our attention. 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll inside of a fixed sidebar - css - Stack Overflow
I've trying to get a fixed header/fixed sidebar with scroll content (nav) working for a mobile site, and no luck until I ran...
Read more >
Scroll/Follow Sidebar, Multiple Techniques | CSS-Tricks
A sidebar that "follows" as you scroll down a page. ... With this technique, the sidebar stays solidly in place as you scroll...
Read more >
Use CSS to fix top and left navigation, and scroll content
Create a top and left navigation with CSS. These navigation panes will stay in the same place on the webpage, even as the...
Read more >
Create Sticky Sidebar on Scroll - YouTube
Create sticky sidebar when scroll with html and css, we also learn how to use flexbox and grid to make it responsive.
Read more >
Sticky Sidebar Navigation on Scroll - CodeMyUI
When you scroll down the page and hit the section with this menu it sticks on the right-hand side till that content block...
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