CodeMirror . Disabling Vertical scroll bar

user1159517 picture user1159517 · Sep 8, 2012 · Viewed 10.9k times · Source

I am currently using CodeMirror to edit CODE in text area in browser. If i have more than 20 lines of code, it is adding a vertical scroll bar to right. But i do not need this scroll bar. Instead i need the editor size to grow vertically.

Can anyone help ?

Answer

JBE picture JBE · Dec 18, 2014

In CodeMirror 3, there is an option to disable the scrollbars : scrollbarStyle: "null"

From the documentation :

scrollbarStyle: string

Chooses a scrollbar implementation. The default is "native", showing native scrollbars. The core library also provides the "null" style, which completely hides the scrollbars. Addons can implement additional scrollbar models.

Combining this with :

And then controlling the height/width of the parent div works well