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

Prevent Codemirror to grow #127

Merged
merged 1 commit into from Jul 10, 2021
Merged

Prevent Codemirror to grow #127

merged 1 commit into from Jul 10, 2021

Conversation

thangngoc89
Copy link
Contributor

When there're too many lines, the editor would grow to fit the whole content.
The usual fix would be defining a maximum height on parent container of .CodeMirror
and position: relative.

Since parent container is this case (#textarea) grow with its container (#editor),
maximum height can't be set without resorting to manual calc .

This PR implement a hacks documented here: https://discuss.codemirror.net/t/size-inside-flexbox/1359/5

You can test this by making the editor has more lines than its parent container.
For example: http://dream.as/k-websocket

When there're too many lines, the editor would grow to fit the whole content.
The usual fix would be defining a maximum height on parent container of `.CodeMirror` 
and `position: relative`.

Since parent container is this case (`#textarea`) grow with its container (`#editor`), 
maximum height can't be set without resorting to manual `calc` .

This PR implement a hacks documented here: https://discuss.codemirror.net/t/size-inside-flexbox/1359/5

You can test this by making the editor has more lines than its parent container.
For example: http://dream.as/k-websocket
@aantron aantron merged commit a8b2e5a into aantron:master Jul 10, 2021
@aantron
Copy link
Owner

aantron commented Jul 10, 2021

Deployed and confirmed, thanks!

@thangngoc89 thangngoc89 deleted the patch-1 branch July 10, 2021 17:19
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.

None yet

2 participants