Open ghenry opened 2 weeks ago
Please try to update LV, 0.20.15 had a bug with patching form contents.
Hi @SteffenDE
I'm on 0.20.17 now, exactly the same. I can't see that I've missed any config or code changes to handle this. The only difference I can see that is needed is going from max_entries: 1
to max_entries: 5
etc.
The multiple
attribute is there on the input field as expected:
<input data-phx-id="m35-phx-F9sMyDH-COEVCCKB" id="phx-F9tJDY1mkBgfEbmI" type="file" name="loa" accept=".pdf" data-phx-hook="Phoenix.LiveFileUpload" data-phx-update="ignore" data-phx-upload-ref="phx-F9tJDY1mkBgfEbmI" data-phx-active-refs="" data-phx-done-refs="" data-phx-preflighted-refs="" required="" class="sr-only" multiple="">
Thanks.
Any ideas?
@ghenry Sorry, I'm very busy at the moment and didn't have the time to look into it yet. It'd be great if you could create a single file script to reproduce the problem. This should be a good start: https://github.com/phoenixframework/phoenix_live_view/blob/main/.github/single-file-samples/main.exs
Will do. That will also allow me to prove if I've got some cruft blocking this simple thing from working.
Environment
Elixir version (elixir -v): Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns] Elixir 1.16.2 (compiled with Erlang/OTP 26)
Phoenix version (mix deps): phoenix (Hex package) (mix) locked at 1.7.14 (phoenix) c7859bc5
Phoenix LiveView version (mix deps): phoenix_live_view (Hex package) (mix) locked at 0.20.15 (phoenix_live_view) 45c48ad1
Operating system: Fedora 40 x86_64 Workstation
Browsers you attempted to reproduce this bug on (the more the merrier): Firefox and Chrome latest
Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes, same
Actual behavior
Multiple files are accepted, but input field shows "Please select file" when Submit is clicked. When switching back to max_entries: 1, all is OK.
Expected behavior
Submit works and multiple files are uploaded.
Thanks for taking the time to read this and for the wonderful Phoenix and Phoenix LiveView.