Phoenix LiveView file uploader says "No files chosen" even after choosing files

I’ve been working with LiveView’s live_upload component recently and it works great, but I do have a question about the input itself. Before selecting any files, the text next to the input says “No file chosen”. That makes sense, but then even after selecting files it still says “No file chosen”.

I’ve been able to successfully perform uploads and get the contents on the server, so the component appears to be working fine. Image previews for selected files also work, so I know when I have files chosen for upload. At first I figured this was an issue with my code, but after watching Chris McCord’s file upload deep dive, his demo worked the same way. (See 32:08, for example-- he’s selected two photos, but the text next to the input still says “No files selected”).

So my question is: what’s the expected functionality here? Why does that “No file chosen” text never seem to change? It’s obviously not a huge concern since the component is functioning for me, but it feels like I’m missing something.

Thanks in advance!

2 Likes