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

Bug - Line Number Alignment Bug (inside Modal) #446

Open
connordear opened this issue Jan 18, 2023 · 4 comments
Open

Bug - Line Number Alignment Bug (inside Modal) #446

connordear opened this issue Jan 18, 2023 · 4 comments

Comments

@connordear
Copy link

connordear commented Jan 18, 2023

I am using a very basic CodeMirror component inside a modal (the modal is from Chakra UI). When I open the modal, initially the line numbers are slightly squished and do not line up correctly. When I click on the editor, the line numbers can be seen 'jumping' into place.

I found some related issues from v5 of CodeMirror that used the autoRefresh addon or editor.refresh() command in order to solve this, but couldn't find autoRefresh in the latest version of CodeMirror.

does anyone know how I can get it to have correct alignment when the modal first opens? or how I can get the autoRefresh addon now?

Code sandbox Demo of bug

@jaywcjlove
Copy link
Member

@tonymaa
Copy link

tonymaa commented Apr 11, 2023

I also met this problem, have you solved it?

@connordear
Copy link
Author

connordear commented Apr 11, 2023

Not really - I wait to load in the codemirror component until the modal has finished its opening animation :/ it does stop the numbers from jumping around.

@jaywcjlove
Copy link
Member

@connordear I don't see what's wrong with the example.

https://codesandbox.io/s/interesting-sun-rllxre?file=/src/App.js

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

No branches or pull requests

3 participants