-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Preserve sidebar height when toggling sidebar #4415
Comments
I would like to pick this up, if anybody has not started any work on this. |
Thanks, nobody is on it, just submit a PR :) |
It's natural to expect that expanding the content part will shift of elements below, and vice versa. Therefore I don't see why that's such a big issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Edit: my comment and discussions above => moved to #7918 (comment) which indeed is a separate issue |
Reverted the title change to prevent confusion with #7918, which are two distinct issues (this one is about maintaining sidebar height; that one is about maintaining page scroll position) |
This is a much better test case, no need to set any zoom level, just click the sidebar collapse button: https://docusaurus.io/tests/docs |
I opened a small PR to solve this issue here #8195 |
Note this page looks also weird on a vertical screen, we should fix that too: https://docusaurus.io/tests/docs There's even a little layout shift on hydration: |
A reproduction of (#4415 (comment)) I believe this only happens when the right content is shorter than the navbar menu. The footer shifts because the additional space needed to fit in an open navbar menu longer than the right content. All the right content is longer than the navbar menu now, so this shouldn't be a problem anymore. Here is an example where the content is longer than the menu and works just fine. However, it is working also because there is no word wrap issue, as discussed in (#7918) The cause for the footer shift should be only the word wrap now. Let me know what you think. Thanks! |
Would you like a CSS detection for the vertical screen and then utilize the same navbar reveal on mobile devices - a button in the top left corner? |
So something like |
Check out this |
This is not a problem of vertical/horizontal/ratio but just having more vh than the sidebar + main content There are good existing repros to both problems here: |
@pea-nut-z honestly not sure what I want exactly, need to see it live and play with it to feel the UX on different edge cases. Can you open a PR with this suggestion? |
It shouldnt be that way, Ive fixed it erlier, apparently it's broken again #7025 |
This issues' bug is fixed by @0916dhkim in #8328 👍 thanks Opened 2 other related docs layout issues discovered in the process: |
Current versionDocusaurus 2.3.1 DescriptionThis issue appears again because someone made a change from: .main-wrapper {
display: block;
}
.main-wrapper docsWrapper_XXXX {
display: flex;
} to .main-wrapper {
display: flex;
flex-direction: column;
}
.main-wrapper docsWrapper_XXXX {
display: flex;
flex-direction: column;
} How to reproduceJust initialize the standard template: npx create-docusaurus@2.3.1 test-doc classic
cd test-doc
npm start Then go to this page:
My solutionI made a hot fixture for this issue by modifying the /* Fix a bug caused by Docusaurus, which makes the sidebar not expand again! */
.docs-wrapper div.main-wrapper {
flex-direction: row;
} But I believe that this issue should be solved by modifying the source codes of Docsauraus. Please take a look at the source codes, sir @slorber. Thank you! |
@cainmagi should be fixed for upcoming v2.4 and v3 already: |
🐛 Bug Report
Refs: #4311
Currently the left sidebar do not preserve the height on some of short pages (with long sidebars?), when toggling between collapsed and expanded states.
This is causing the visual "jump" of footer each time user interacts with sidebar mode.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
EDIT @slorber: note to self: the content is smaller than the sidebar. Don't use the Markdown features page: as of 2022 it is now taller. A better repro page is https://docusaurus.io/tests/docs
Expected behavior
Footer is not "jumping", sidebar height is preserved.
Actual Behavior
Footer is "jumping", sidebar height is not preserved.
Preview
Your Environment
N/A
Reproducible Demo
The text was updated successfully, but these errors were encountered: