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