-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Problem with autoresize and min height #615
Comments
Here is some workaround I found to overwrite the height of const theme = EditorView.theme({
"& div.cm-scroller": {
minHeight: `${minHeight} !important`,
},
})
return (
<CodeMirror
minHeight={minHeight}
maxHeight="75vh"
theme={colorScheme === "dark" ? "dark" : "light"}
extensions={[theme]}
value={optionsSource}
/>
) It's a bit ugly, but now the horizontal scrollbar is on the bottom of the editor pane. But I still wonder why the |
Not sure if this is a solution. <CodeMirror
height="100%"
style={{ height: "100%" }}
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to use react-codemirror in an editor that auto-resizes, but I still want to use a minimum height. Unfortunately, react-codemirror does set
height: '100% !important'
on the.cm-scroller
element. That way, I always end up with something like this when only adding aminHeight
andmaxHeight
:I would like to have the horizontal scrollbar at the bottom of the editor, but still want it to grow until a given height.
Is there a good workaround for having an auto-resizing editor that also has a minimum height? Or can I turn off the
height: '100% !important'
somehow?The text was updated successfully, but these errors were encountered: