I use codemirror with text fields in a tabbed interface, when Iām not on the tab containing codemirror and then go to it, I get empty white space without line numbers or cursor, when I refresh the page it works, I know this because the contents of the tabs hidden by display: none; so how can i fix this problem?
here is my code, (I also use jquery):
var editor = CodeMirror.fromTextArea(document.getElementById($this.attr('id')), { lineNumbers: true, mode: text/html, enterMode: "keep", tabMode: "shift" }); $(editor.getScrollerElement()).width(300); width = $(editor.getScrollerElement()).parent().width(); $(editor.getScrollerElement()).width(width); editor.refresh();
early.
Pierre
source share