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

Fixing a couple of forced reflows in our tutorial components #9733

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Oct 20, 2023

Fixes two perf issues for tutorials:

First, the tutorial callout was running it's resize observer even when not visible. The callback for the observer was checking the height of an element, which forces the browser to rerender elements to get an accurate number. I guarded this behind a check to see if the callout is visible and also cleaned up the event listeners in that component a little bit while I was there.

Second, the tutorial container was running a querySelector to get a reference to its container so that it could run a resize observer on it. Query selectors also force reflows, so I changed this to instead use a ref of the container element.

Finally, I fixed a small CSS bug that I noticed when resizing tutorials where the editor sidebar wasn't taking up the whole height of the editor.

@riknoll riknoll requested review from thsparks and a team October 20, 2023 22:58
Copy link
Contributor

@thsparks thsparks left a comment

Choose a reason for hiding this comment

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

Nice, ty!

@riknoll riknoll merged commit 7698fc7 into master Oct 23, 2023
7 checks passed
@riknoll riknoll deleted the dev/riknoll/perf-fixes branch October 23, 2023 16:27
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