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

DOP-873: Fix sidebar/left navtab on-load flashing #169

Merged
merged 3 commits into from
Mar 31, 2020
Merged

DOP-873: Fix sidebar/left navtab on-load flashing #169

merged 3 commits into from
Mar 31, 2020

Conversation

mango-db
Copy link
Contributor

DOP-873.

The Bug

During the pre-render phase, the window size is undefined. This caused cascading effects in which the showLeftColumn state was false during pre-render. Then, on load, the left column would briefly flash closed before opening. To fix, we add an !isBrowser() check to the logic to ensure that all elements are pre-rendered. During pre-render, the CSS behavior is defined by mongodb-base.css. Post-render, the styles in navigation.module.css now have an additional postRender class such that showNav.postRender and left-column.postRender allow React's toggleLeftColumn() behavior.

Staging

Copy link
Member

@sophstad sophstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thanks for the thorough explanation of your work 💯

Would appreciate a brief comment (maybe around line 32) explaining what that code is for.

@mango-db mango-db merged commit 1cac63c into master Mar 31, 2020
@mango-db mango-db deleted the DOP-873 branch March 31, 2020 14:06
graysonhicks pushed a commit that referenced this pull request Jan 20, 2023
* DOP-873: Fix sidebar/left navtab on-load flashing

* DOP-873: Address PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants