Fix persistent insert mode in modals

This commit is contained in:
Jonatan Kłosko 2021-07-05 23:33:21 +02:00
parent 9b2f039e29
commit d0ec965fad
2 changed files with 4 additions and 1 deletions

View file

@ -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;
}

View file

@ -38,7 +38,7 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do
<div>
<label>
<%= live_file_input @uploads.cell_image, class: "hidden" %>
<div class="inline-block cursor-pointer button button-gray button-square-icon">
<div class="cursor-pointer button button-gray button-square-icon">
<%= remix_icon("folder-upload-line") %>
</div>
</label>