Force rendering when the editor is not visible?

Is there a way to force rendering (showing content) when the editor is not visible?

I have a case where we have multiple tabs, and to states, we force all the tabs, including the ones that aren’t selected yet, to render in the DOM. The issue is that CodeMirror is rendered in the DOM while not being displayed, and it does not render the initial text. The work around is to issue a refresh() once the tab becomes visible, but that is difficult to detect, it’d be a lot simpler if we could force CodeMirror to render text even when it isn’t visible, in which case a refresh() right after the setValue() would solve the issue.

No, this is not possible. The editor bases its viewport and layout on actual dom measurements, which aren’t available when not visible.

1 Like

Hmm, I thought a little differently, thanks for the explanation!