Closed Munksgaard closed 4 days ago
This is expected behavior. The <.live_file_input />
function component uses a specific id for tracking upload entries. There is an example in the docs for using the upload config ref for the label:
Rendering a file input with a label:
<label for={@uploads.file.ref}>File</label>
<.live_file_input upload={@uploads.file} />
The docs can be updated to make this clearer :)
Thank you for the explanation!
Actual behavior
Here is a minimal reproducing example:
Clicking the label does not trigger the file upload dialog. Nor does the
<input>
generated by<.live_file_input>
contain the correctid
attribute. Instead, it contains something likeid="phx-F95k0m6WLoF-OQBC"
Expected behavior
The documentation specifies that
live_file_input
accepts all global attributes, one of which isid
. Therefore I would expect that anyid
that I specify is passed on to the resultinginput
element.