In the demos, if you enter more text than will fit in the editor, the editor simply grows. How does one keep the editor the same size, but enable scrollbars?
I have tried setting a max-width on .CodeMirror, which does keep the editor from growing. But the scrollbars never show.
I also set overflow: scroll on .CodeMirror. Scrollbars appear, but they don't work. Despite having additional text, the editor will not scroll.
Looks like the problem was that my project had other css files for codemirror that were the culprit.
This is what enabled it for me:
.CodeMirror {
height: 300px;
}
although you may also need:
overflow-y: auto;
My problem was that we were already using codemirror in the project, so the original CSS files, which were included _after_ mine, were overriding these values.
Thanks!
Most helpful comment
This is what enabled it for me:
.CodeMirror {
height: 300px;
}
although you may also need:
overflow-y: auto;
My problem was that we were already using codemirror in the project, so the original CSS files, which were included _after_ mine, were overriding these values.