mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 09:03:02 +08:00
Fix keyboard control
This commit is contained in:
parent
56df5a3802
commit
c23372bf53
1 changed files with 2 additions and 2 deletions
|
@ -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})
|
||||
|
|
Loading…
Reference in a new issue