From 35e42d1bad4f3cd18876b8cb11a433dbf0ccd243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Sat, 15 Jan 2022 23:08:45 +0100 Subject: [PATCH] Keep editor background on rerender (#869) --- assets/js/cell/index.js | 2 +- .../live/session_live/cell_component.ex | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/assets/js/cell/index.js b/assets/js/cell/index.js index a653b9b5a..fcc8e663c 100644 --- a/assets/js/cell/index.js +++ b/assets/js/cell/index.js @@ -45,7 +45,7 @@ const Cell = { editorContainer.appendChild(editorElement); // Adjust the background color based on local settings const settings = loadLocalSettings(); - editorContainer.parentElement.style.backgroundColor = + editorContainer.style.backgroundColor = THEME_BACKGROUND_COLOR[settings.editor_theme]; // Setup the editor instance. this.state.liveEditor = new LiveEditor( diff --git a/lib/livebook_web/live/session_live/cell_component.ex b/lib/livebook_web/live/session_live/cell_component.ex index ca12a0c47..8b31cf0fe 100644 --- a/lib/livebook_web/live/session_live/cell_component.ex +++ b/lib/livebook_web/live/session_live/cell_component.ex @@ -212,13 +212,12 @@ defmodule LivebookWeb.SessionLive.CellComponent do defp editor(assigns) do ~H""" -
-
-
- <.content_placeholder bg_class="bg-gray-500" empty={@cell_view.empty?} /> +
+
+
+
+ <.content_placeholder bg_class="bg-gray-500" empty={@cell_view.empty?} /> +