Fix accessbility of file input

This commit is contained in:
Chris McCord 2022-02-04 16:06:41 -05:00
parent 819d5ecc98
commit 337931e21e

View file

@ -46,10 +46,10 @@
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<div class="flex text-sm text-gray-600">
<label for={@uploads.mp3.ref} class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
Upload files
<label for="file-upload" class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
<span phx-click={js_exec("##{@uploads.mp3.ref}", "click", [])}>Upload files</span>
<%= live_file_input @uploads.mp3, class: "sr-only", tabindex: "0" %>
</label>
<%= live_file_input @uploads.mp3, class: "sr-only", tabindex: "0" %>
<p class="pl-1">or drag and drop</p>
</div>
<p class="text-xs text-gray-500">