Skip to content
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

Table of Contents Max Height Inconsistency #559

Open
dtimsullivan opened this issue Dec 20, 2022 · 7 comments
Open

Table of Contents Max Height Inconsistency #559

dtimsullivan opened this issue Dec 20, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@dtimsullivan
Copy link

Describe the Bug

On a page with a lot of headers, the table of contents goes past the bottom of the viewport. Which wouldn't normally be a problem, thanks to the scroll bar, but the scroll bar isn't displaying all of the headers when scrolling down. It seems to cut them off, expecting you to scroll down the page itself to see more. My guess is that this has to do with how the max-height is being calculated for the ToC, but I'm not sure. However, scrolling down the page switches to the ToC to the sticky version, which has proper height formatting. In the sticky ToC, you can scroll to the top and bottom of the list without an issue.

Steps to reproduce the behavior:

  1. Create a page with a large amount of headers. At least enough to cause the ToC to go past the bottom of the viewport.
  2. Try to scroll to the bottom of the ToC.
  3. See missing items.
  4. Scroll down viewport to change to sticky ToC.
  5. Scroll to the top and bottom of the ToC without an issue.

Expected Behavior

I would expect that if I had just opened a page, I could scroll the ToC to any position and be able to see all available headers, without having to scroll the page itself.

System

  • MediaWiki Version: 1.39
  • Citizen Skin Version: 2.3.0

Non-sticky, scrolled to the top:
ToC1

Non-sticky, scrolled to the bottom:
ToC2

Sticky, scrolled to the top:
ToC3

Sticky, scrolled to the bottom:
ToC4

Thank you!

@dtimsullivan dtimsullivan added the bug Something isn't working label Dec 20, 2022
@alistair3149
Copy link
Member

Thanks for reporting the bug!
Yes you are correct it stems from how max height is calculated currently.
Currently the ToC max height is taking an assumption of how tall is sticky header, which can be dynamic because of different screen sizes and overflow. I would look into it

alistair3149 added a commit that referenced this issue Dec 20, 2022
That would keep the sticky first header to always be one line, also solves #559
@alistair3149
Copy link
Member

Would you mind to check if the current patch fixes it for you?

@dtimsullivan
Copy link
Author

I replaced the StickyHeader.less file with the one you updated. However, I'm not seeing any changes in the table of contents behavior. Were there additional steps I needed to take?

@alistair3149
Copy link
Member

Oops sorry I missed one rule, should be fixed now.
Please let me know if it works for you!

@dtimsullivan
Copy link
Author

Looks like the ToC without the sticky header is still being cut off at the bottom of the view port when resting at the top of the page.

@alistair3149
Copy link
Member

Looks like the ToC without the sticky header is still being cut off at the bottom of the view port when resting at the top of the page.

Ah I see what you mean. That is a bit more complicated to fix and I am currently away for holiday, I will look into it when I come back!

@dtimsullivan
Copy link
Author

No problem! I appreciate you looking in to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants