In Phoenix Liveview uploads, you need to surround the upload helper function in a form, with a submit button.
How can I build something a little more like Github’s experience where you can just upload the image and it gets sent to the server to update the user avatar?
I don’t really care about the dropdown.
Really what I’m looking for is having a button that triggers the file picker dialog, and then automatically submits the form would be a good UX for my usecase.
Auto uploading can be set by the auto_upload: true option of Phoenix.LiveView.allow_upload/3
Auto submitting can be triggered by serveral ways. The one I used is to trigger it in the callback of JS uploader with form.dispatchEvent(new Event("submit", {bubbles: true, cancelable: true}))