diff --git a/assets/js/session/index.js b/assets/js/session/index.js index dfbe7981b..3af405a10 100644 --- a/assets/js/session/index.js +++ b/assets/js/session/index.js @@ -343,6 +343,9 @@ function handleDocumentKeyDown(hook, event) { function handleDocumentMouseDown(hook, event) { // If the click is outside the notebook element, keep the focus as is if (!event.target.closest(`[data-element="notebook"]`)) { + if (hook.state.insertMode) { + setInsertMode(hook, false); + } return; } diff --git a/lib/livebook_web/live/session_live/cell_upload_component.ex b/lib/livebook_web/live/session_live/cell_upload_component.ex index ae3e439dd..f0637ec51 100644 --- a/lib/livebook_web/live/session_live/cell_upload_component.ex +++ b/lib/livebook_web/live/session_live/cell_upload_component.ex @@ -38,7 +38,7 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do