diff --git a/lib/atomic_web/components/image_uploader.ex b/lib/atomic_web/components/image_uploader.ex index 7ff53319..839b3760 100644 --- a/lib/atomic_web/components/image_uploader.ex +++ b/lib/atomic_web/components/image_uploader.ex @@ -6,6 +6,7 @@ defmodule AtomicWeb.Components.ImageUploader do @target - the target to send the event to @width - the width of the uploader area @height - the height of the uploader area + @id - a unique identifier for this uploader instance The component events the parent component should define are: cancel-image - cancels the upload of an image. This event should be defined in the component that you passed in the @target attribute. @@ -13,15 +14,17 @@ defmodule AtomicWeb.Components.ImageUploader do use AtomicWeb, :live_component def render(assigns) do + unique_ref = assigns.id <> "_upload" # Generate a unique reference using the passed id + ~H"""
or drag and drop