Skip to content

Commit

Permalink
Added 50ms timeout to ensure editor is visible.
Browse files Browse the repository at this point in the history
Closes #1163.
  • Loading branch information
imolorhe committed Jan 29, 2020
1 parent 6c34dd8 commit 5c380c3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/altair-app/src/app/utils/codemirror/refresh-editor.ts
@@ -1,10 +1,11 @@
export const handleEditorRefresh = (cm: any) => {
if (cm) {
if (cm.display.wrapper.offsetHeight) {
if (cm.display.lastWrapHeight !== cm.display.wrapper.clientHeight) {
console.log('changes', cm);
cm.refresh();
setTimeout(() => {
if (cm && cm.display.wrapper.offsetHeight) {
if (cm.display.lastWrapHeight !== cm.display.wrapper.clientHeight) {
cm.refresh();
}
}
}
}, 50);
}
};

0 comments on commit 5c380c3

Please sign in to comment.