- importVersioned('code').then(Code => {
- this.cm = Code.wysiwygView(container, this.getContent(), this.getLanguage());
+ const renderCodeMirror = (Code) => {
+ this.cm = Code.wysiwygView(container, content, this.getLanguage());
+ setTimeout(() => Code.updateLayout(this.cm), 10);
+ setTimeout(() => this.style.height = null, 12);
+ };
+
+ window.importVersioned('code').then((Code) => {
+ const timeout = (Date.now() - connectedTime < 20) ? 20 : 0;
+ setTimeout(() => renderCodeMirror(Code), timeout);