Skip to content

Resize Codemirror instance when editor is resized#325

Open
DallasHoff wants to merge 1 commit into
pd4d10:mainfrom
DallasHoff:main
Open

Resize Codemirror instance when editor is resized#325
DallasHoff wants to merge 1 commit into
pd4d10:mainfrom
DallasHoff:main

Conversation

@DallasHoff

Copy link
Copy Markdown

This is a bug fix for the editor appearing broken after being resized. Currently when the Editor component is resized (such as when switching to fullscreen mode), the underlying Codemirror editor does not update to fit the new size. This means that elements in the editor are misaligned until the user types in it or performs some other action that causes Codemirror to recalculate the sizes. This PR adds a call to Codemirror's refresh method in the existing ResizeObserver so that when the editor is resized, the editor instantly updates its layout accordingly.

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.

1 participant