From d0ec965fad4b72f263396280403446fef98276bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Mon, 5 Jul 2021 23:33:21 +0200 Subject: [PATCH] Fix persistent insert mode in modals --- assets/js/session/index.js | 3 +++ lib/livebook_web/live/session_live/cell_upload_component.ex | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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