Make file dropzone ids unique (#1699)

This commit is contained in:
Jonatan Kłosko 2023-02-09 12:34:46 +01:00 committed by GitHub
parent 60d8c6fb54
commit 52bc694059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -185,7 +185,7 @@ defmodule LivebookWeb.FileSelectComponent do
class="grow -m-1 p-1 h-full rounded-lg overflow-y-auto tiny-scrollbar"
tabindex="-1"
phx-hook="Dropzone"
id="upload-file-dropzone"
id="file-select-upload-dropzone"
>
<form phx-change="file_validate" phx-drop-target={@uploads.folder.ref} phx-target={@myself}>
<%= live_file_input(@uploads.folder, class: "hidden", aria_labelledby: "import-from-file") %>

View file

@ -28,7 +28,7 @@ defmodule LivebookWeb.HomeLive.ImportFileUploadComponent do
<div
class="flex flex-col justify-center items-center w-full rounded-xl border-2 border-dashed border-gray-400 h-48"
phx-hook="Dropzone"
id="upload-file-dropzone"
id="import-file-upload-dropzone"
>
<%= if @uploads.notebook.entries == [] do %>
<span name="placeholder" class="font-medium text-gray-400">Drop your notebook here</span>

View file

@ -35,7 +35,7 @@ defmodule LivebookWeb.Output.FileInputComponent do
class="inline-flex flex-col gap-4 p-4 border-2 border-dashed border-gray-200 rounded-lg cursor-pointer"
phx-drop-target={@uploads.file.ref}
phx-hook="Dropzone"
id="upload-file-dropzone"
id={"#{@id}-upload-dropzone"}
>
<div class="flex justify-center text-gray-500">
<%= if @value do %>