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

fix(init-mode): avoid unnecessary unmonted state #294

Merged
merged 2 commits into from
Jan 7, 2022
Merged

Conversation

danilowoz
Copy link
Member

Refactors to improve the condiction around when the editor should be mounted and unmounted. Previously, the Editor has been destroying every time it was out of the viewport (which was causing layout shift very often), plus this is an unnecessary step, because once the editor is mounted there is no advantage of destroying and mounting it again.

Closes #293

@danilowoz danilowoz self-assigned this Jan 7, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 7, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5b85345:

Sandbox Source
Sandpack Blog Example 1 Configuration

@vercel vercel bot temporarily deployed to Preview – sandpack-theme January 7, 2022 11:42 Inactive
@vercel vercel bot temporarily deployed to Preview – sandpack-theme January 7, 2022 11:55 Inactive
@vercel vercel bot temporarily deployed to Preview – sandpack-docs January 7, 2022 11:55 Inactive
@vercel vercel bot temporarily deployed to Preview – sandpack-landing January 7, 2022 11:55 Inactive
@danilowoz danilowoz merged commit 8a8bc11 into main Jan 7, 2022
@danilowoz danilowoz deleted the fix/init-mode branch January 7, 2022 12:07
danilowoz added a commit that referenced this pull request Jan 7, 2022
* fix(init-mode): avoid unnecessary unmonted state

* refactor
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.

Bug: Sandpack causing viewport to jump in iOS browsers
1 participant