**Steps to replicate the issue** (include links if applicable):
* Go to a page that has many sections, such that the table of content expands past the body view port (on most resolutions this may be seen here: https://test.wikipedia.org/w/index.php?title=BigDockedTOC&oldid=584288&useskin=vector-2022 OR https://en.wikipedia.beta.wmflabs.org/wiki/T352930?useskin=vector-2022)
* Assuming the TOC is on the sidebar, click HIDE next to it
* Open the TOC from the menu next to the article title
* Attempt to scroll down to see items towards the bottom of the TOC
**What happens?**:
* The page layout rearranges when the TOC is scrolled toward the bottom of the screen, closing the TOC and preventing you from ever getting to the bottom
* ADDITIONALLY, even if you reopen the TOC from the now-relocated section, the TOC extends past the viewport on the bottom of the screen, preventing you from ever being able to scroll down to the items lower on the TOC
**What should have happened instead?**:
* Not sure what the "best" fix is, but suggest that dynamic section scrolling happen in the TOC, such as how the sidebar will produce a vertical scroll bar when needed
**Software version** (skip for WMF-hosted wikis like Wikipedia):
WMF production
**Other information** (browser name/version, screenshots, etc.):
Originally reported on enwiki by Steue, see https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1188674279#Hidden_ToC_dis-appeares_on_it's_own_during_scrolling
# QA steps
[] QA T352930 and determine whether the fix here addresses that one.