diff --git a/assets/js/app.js b/assets/js/app.js index 5d1910107..2d7e8b825 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -79,3 +79,13 @@ liveSocket.connect(); // >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session // >> liveSocket.disableLatencySim() window.liveSocket = liveSocket; + +// Handling custom events dispatched with JS.dispatch/3 + +window.addEventListener("lb:focus", (event) => { + event.target.focus(); +}); + +window.addEventListener("lb:set_value", (event) => { + event.target.value = event.detail.value; +}); diff --git a/lib/livebook_web/live/file_select_component.ex b/lib/livebook_web/live/file_select_component.ex index 63a62a9b5..ff74a1130 100644 --- a/lib/livebook_web/live/file_select_component.ex +++ b/lib/livebook_web/live/file_select_component.ex @@ -36,7 +36,6 @@ defmodule LivebookWeb.FileSelectComponent do submit_event: nil, # State current_dir: nil, - new_dir_name: nil, deleting_file: nil, renaming_file: nil, renamed_name: nil, @@ -90,7 +89,7 @@ defmodule LivebookWeb.FileSelectComponent do <.remix_icon icon="add-line" class="text-xl" />