Skip to content

fix(ui-file-drop): underlying HTML input's 'files' prop is now populated when dropping a file#1904

Merged
matyasf merged 1 commit intomasterfrom
filedrop_dropfix
Mar 17, 2025
Merged

fix(ui-file-drop): underlying HTML input's 'files' prop is now populated when dropping a file#1904
matyasf merged 1 commit intomasterfrom
filedrop_dropfix

Conversation

@matyasf
Copy link
Collaborator

@matyasf matyasf commented Mar 14, 2025

By default browsers do not populate the input's files and value prop when a file is dropped (its populated when clicking on the control). This PR populates files prop when dropping (and the value prop which is calculated from this one)

To test:
Drop files into a FileDrop example, you should see the files object populated in devtool's "Properties" tab or in the console.
Test it with Chrome, Safari, FF

Fixes INSTUI-4476

@matyasf matyasf self-assigned this Mar 14, 2025
@github-actions
Copy link

github-actions bot commented Mar 14, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://instructure.design/pr-preview/pr-1904/

Built to branch gh-pages at 2025-03-17 13:31 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…via drag and drop

Browsers dont populate this field by default, one needs to do via JS

INSTUI-4476
@matyasf matyasf merged commit 5842034 into master Mar 17, 2025
7 of 8 checks passed
@matyasf matyasf deleted the filedrop_dropfix branch March 17, 2025 13:26
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.

3 participants