Open viseth opened 3 years ago
Is the editor hidden or otherwise unable to figure out its own on size when you call setValue
? If so, you have to schedule the refresh
call at the point where it becomes visible again. Toggling autorefresh
off and then on again might also work.
Hi,
The "refresh" add-on works like a charm when we need to refresh only one time. Now if the textarea needs to be refresh a second time... For instance new content has been set, then the value of the codemirror instance is set but it is not shown until we click the textarea.
try this to no avail.
` var codeMirrorRef = CodeMirror.fromTextArea(document.getElementById("id_commentsHint"), { mode: "javascript", autoRefresh:true, });
codeMirrorRef.setValue(content); setTimeout(function() { codeMirrorRef.refresh(); },1); `
Please advice, Thanks,