Hey everyone! I’m looking to have the same behaviour shown on this topic here: Code editor with automatic height that has a minimum and maximum height?
But I’m still on Codemirror 5 and couldn’t correctly style it to have scrolling. Essentially I can get the editor to resize automatically but no scrollbar is shown if it hits a maximum size. This is what I have tried:
<style>
.CodeMirror {
border: 1px solid #eee;
height: auto;
max-height: 500px;
width: auto;
}
</style>
var editor = CodeMirror.fromTextArea(myTextarea, {
lineNumbers: false,
lineWrapping: true,
viewportMargin: Infinity,
});
Anyone knows how to enable scrolling with this?