CodeMirror seems to be working really well except when I have only a few (3 or less) lines of code in the textarea. When that happens, the textarea is blank until I (A) hit enter in the textarea or (B) do something that causes the browser to repaint (like resizing). When there are more than 3 lines, they show up just fine on first render of the page.
I'm not doing anything fancy here:
var editor = CodeMirror.fromTextArea(document.getElementById('html'), {
mode: 'text/html',
tabMode: 'indent',
lineNumbers: true
});
Just wondering if anyone else has had this issue.
Use the refresh method after creating the CodeMirror instance... editor.refresh() It happened to me when trying to insert an editor within a dijit.Dialog when I was yet hidden. It did the trick for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With