Browse Source

Add TODO for the requestAnimationFrame

Jeremy Tuloup 5 years ago
parent
commit
140cee3efd
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/handlers/notebook.ts

+ 6 - 4
src/handlers/notebook.ts

@@ -54,11 +54,13 @@ export class NotebookHandler implements IDisposable {
     notebookTracker: NotebookTracker,
     codeCell: CodeCell
   ) {
-    if (notebookTracker.currentWidget.id === this.id) {
-      requestAnimationFrame(() => {
-        this.cellManager.activeCell = codeCell;
-      });
+    if (notebookTracker.currentWidget.id !== this.id) {
+      return;
     }
+    // TODO: do we need this requestAnimationFrame?
+    requestAnimationFrame(() => {
+      this.cellManager.activeCell = codeCell;
+    });
   }
 
   private notebookTracker: INotebookTracker;