WordPress/wporg-developer

TOC isn't position fixed when if it's too long

Closed this issue ยท 6 comments

Too much content makes the TOC long and not position-fixed anymore.
It should be scrollable as well as having a fixed position.

Example: https://developer.wordpress.org/redesign-test/reference/functions/register_post_type/#more-information

This is by design, but maybe is worth reviewing, @WordPress/meta-design ?

This was indeed by design, yes, but upon some reflection also partially detailed in #341 I think we can potentially revisit that design decision. That is, have both chapters (when available) and TOC be sticky and scroll with you down the page, have a max-height of 100% as well as overflow: auto; so those panels scroll independently when they need to. The main challenge here is the scrollbars will feel clunky, but I would think we can address that with custom styles.

I like how X (twitter) solves this sticky and overflow component, but not sure if it's similar to Joen's suggestion.

twitter-x.scroll.mp4

I'm going to put this post-launch as I think it's too much of a lift for MVP

When using a narrower window, the ToC is inline and closed. It scrolls with the content. Why?
When the window is wider, it is on the right, open, and fixed position.

Fixed in #469