Skip to content

Standardize Window.onDropFile in JS.#1

Closed
player-03 wants to merge 1 commit intoShaharMS:feature/drop-event-apifrom
player-03:drop-event-api
Closed

Standardize Window.onDropFile in JS.#1
player-03 wants to merge 1 commit intoShaharMS:feature/drop-event-apifrom
player-03:drop-event-api

Conversation

@player-03
Copy link
Copy Markdown

Now instead of getting a FileList object, you get a string URL just like on other platforms. If the file is an image, this URL can be loaded via Image.loadFromFile(), as expected. If not, it can be loaded using any other standard way to load URLs.

Since loading is required either way, I don't believe this hurts performance in any meaningful way. However, it does allocate an object URL that won't be deallocated until the page is closed or the user calls js.html.URL.revokeObjectURL(). I'm not too worried about this.

Now instead of getting a `FileList` object, you get a string URL just
like on other platforms. If the file is an image, this URL can be loaded
via `Image.loadFromFile()`, as expected. If not, it can be loaded using
any other standard way to load URLs.

Since loading is required either way, I don't believe this hurts
performance in any meaningful way. However, it does allocate an object
URL that won't be deallocated until the page is closed or the user calls
`js.html.URL.revokeObjectURL()`. I'm not too worried about this.
@player-03
Copy link
Copy Markdown
Author

Now that openfl#1461 is merged, this is redundant.

@player-03 player-03 closed this Apr 16, 2023
@player-03 player-03 deleted the drop-event-api branch April 16, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant