From c23372bf53c879b715eecd33ad4fae8af0e2af1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Fri, 27 Oct 2023 23:37:21 +0700 Subject: [PATCH] Fix keyboard control --- lib/livebook_web/live/output/control_component.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/livebook_web/live/output/control_component.ex b/lib/livebook_web/live/output/control_component.ex index f59a3b2a5..53f29ebb4 100644 --- a/lib/livebook_web/live/output/control_component.ex +++ b/lib/livebook_web/live/output/control_component.ex @@ -14,7 +14,7 @@ defmodule LivebookWeb.Output.ControlComponent do id={"#{@id}-root"} phx-hook="KeyboardControl" data-cell-id={@cell_id} - data-default-handlers={@control.default_handlers.attrs} + data-default-handlers={@control.attrs.default_handlers} data-keydown-enabled={to_string(@keyboard_enabled and :keydown in @control.attrs.events)} data-keyup-enabled={to_string(@keyboard_enabled and :keyup in @control.attrs.events)} data-target={@myself} @@ -105,7 +105,7 @@ defmodule LivebookWeb.Output.ControlComponent do end defp maybe_report_status(socket, enabled) do - %{assigns: %{attrs: attrs, keyboard_enabled: current}} = socket + %{assigns: %{control: %{attrs: attrs}, keyboard_enabled: current}} = socket if :status in attrs.events and enabled != current do report_event(socket, %{type: :status, enabled: enabled})