Browse Source

Fix race condition in output area widget

Steven Silvester 8 năm trước cách đây
mục cha
commit
6eb6395cb6
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/notebook/output-area/widget.ts

+ 6 - 1
src/notebook/output-area/widget.ts

@@ -417,7 +417,12 @@ class OutputAreaWidget extends Widget {
       let rect = this.node.getBoundingClientRect();
       let oldHeight = this.node.style.minHeight;
       this.node.style.minHeight = `${rect.height}px`;
-      setTimeout(() => { this.node.style.minHeight = oldHeight; }, 50);
+      setTimeout(() => {
+        if (this.isDisposed) {
+          return;
+        }
+        this.node.style.minHeight = oldHeight;
+      }, 50);
 
       let oldValues = args.oldValue as nbformat.IOutput[];
       for (let i = args.oldIndex; i < oldValues.length; i++) {