diff --git a/src/notebook/components/notebook.js b/src/notebook/components/notebook.js
index <HASH>..<HASH> 100644
--- a/src/notebook/components/notebook.js
+++ b/src/notebook/components/notebook.js
@@ -70,7 +70,7 @@ export function getLanguageMode(notebook: any): string {
   return language;
 }
 
-export function scrollToElement(el) {
+export function scrollToElement(el: HTMLElement): int {
   const viewportHeight = window.innerHeight;
   const viewportOffset = document.body.scrollTop;
 
@@ -91,7 +91,7 @@ export function scrollToElement(el) {
     const offset = viewportHeight - cellHeight;
     return cellTop - offset;
   }
-  return undefined;
+  return document.body.scrollTop;
 }
 
 const mapStateToProps = (state: Object) => ({
chore(NotebookTesting): Add flow typing, return scrollTop.