MartinP
MartinP

Reputation: 405

How to show spinner while Safari is converting HEIC to JPEG via <input type=file>

Safari allows you to select HEIC files with

<input type="file" accept="image/jpeg">

and it automatically converts them to JPEG. The conversion could be slow for multiple files on slower machines. I want to fill the waiting time between choosing the files and the firing of the the "onchange" event with a spinner.

I'm able to show a spinner when the user clicks on the input, and hide it when the "onchange" event fires. The problem is that if the user cancels the "Choose files" dialog there is no event.

Upvotes: 4

Views: 788

Answers (2)

MartinP
MartinP

Reputation: 405

This is not needed anymore. In newer MacOS there is a spinner when choosing files from Finder.

Upvotes: 1

Yusufk
Yusufk

Reputation: 1182

This might be useful. It checks if something was added to the input field, i.e. a file was selected or not.

Upvotes: 0

Related Questions