There actually already were two functions for exactly that purpose. handleDropEvent can be called with an external DragEvent when a file was dropped somewhere. handleChangeEvent can be called with an external InputEvent when files were added to an input element.
The only thing I had to change was to move some CSS handling from handleDropEvent into an own function, so that this can still be done when assignDrop was used, but is not always done when handleDropEvent is called from the outside.
Additionally I also did some minor changes tot he test.html. This file is very barebones but maybe we can use it in the future and now it at least works again. 😄
There actually already were two functions for exactly that purpose.
handleDropEvent
can be called with an externalDragEvent
when a file was dropped somewhere.handleChangeEvent
can be called with an externalInputEvent
when files were added to an input element.The only thing I had to change was to move some CSS handling from
handleDropEvent
into an own function, so that this can still be done whenassignDrop
was used, but is not always done whenhandleDropEvent
is called from the outside.Additionally I also did some minor changes tot he
test.html
. This file is very barebones but maybe we can use it in the future and now it at least works again. 😄