Within the realm of HTML, you may encounter an
<input type="file">
element that can be linked to one or more event handlers. However, if one event handler includes asynchronous code, it will pause at that point and move on to the next event handler.
For instance, consider using window.createImageBitmap
: https://jsfiddle.net/mxpy5qbw/1/
If the method window.createImageBitmap
had a synchronous version, this issue could be resolved.
I am seeking a solution to ensure that the first event handler (such as onChangeEvent
in the JSFiddle example) does not finish executing until all tasks are completed before moving on to the next event handler.
Furthermore, keep in mind that onChangeEvent
(as shown in the example) is a custom event handler, while other event handlers may originate from sources beyond my control.