Browse Source

Merge pull request #2256 from blink1073/fix-rendering-md

Fix input area rendering and scrolling
Afshin Darian 8 years ago
parent
commit
1630266a33
2 changed files with 3 additions and 5 deletions
  1. 2 4
      packages/cells/src/inputarea.ts
  2. 1 1
      packages/notebook/src/actions.ts

+ 2 - 4
packages/cells/src/inputarea.ts

@@ -116,9 +116,8 @@ class InputArea extends Widget {
     let layout = this.layout as PanelLayout;
     if (this._rendered) {
       this._rendered.parent = null;
-    } else {
-      this._editor.parent = null;
     }
+    this._editor.hide();
     this._rendered = widget;
     layout.addWidget(widget);
   }
@@ -127,11 +126,10 @@ class InputArea extends Widget {
    * Show the text editor.
    */
   showEditor(): void {
-    let layout = this.layout as PanelLayout;
     if (this._rendered) {
       this._rendered.parent = null;
-      layout.addWidget(this._editor);
     }
+    this._editor.show();
   }
 
   /**

+ 1 - 1
packages/notebook/src/actions.ts

@@ -858,7 +858,7 @@ namespace Private {
       widget.activate();
     }
     // Scroll to the top of the previous active cell output.
-    let er = state.activeCell.editorWidget.node.getBoundingClientRect();
+    let er = state.activeCell.inputArea.node.getBoundingClientRect();
     widget.scrollToPosition(er.bottom);
   }