Skip to content

@uppy/dashboard: My Device button respects fileManagerSelectionType#6258

Open
EnverUsta wants to merge 4 commits intotransloadit:mainfrom
EnverUsta:fix-my-device-fileManagerSelectionType
Open

@uppy/dashboard: My Device button respects fileManagerSelectionType#6258
EnverUsta wants to merge 4 commits intotransloadit:mainfrom
EnverUsta:fix-my-device-fileManagerSelectionType

Conversation

@EnverUsta
Copy link
Copy Markdown

Fixes #6256

Problem

When fileManagerSelectionType is set to 'folders', clicking the My Device tab/button
still opens the file picker instead of the folder picker.

The inline "browse" link in the tagline correctly respects the setting, but
renderMyDeviceAcquirer in AddFiles.tsx always called triggerFileInputClick
regardless of the fileManagerSelectionType prop.

Solution

renderMyDeviceAcquirer now reads fileManagerSelectionType and calls
triggerFolderInputClick when set to 'folders', or triggerFileInputClick
for 'files' and 'both'.

For 'both' mode, the button defaults to file selection because a single
HTML <input> cannot handle both files and folders simultaneously
(webkitdirectory is all-or-nothing). The folder picker remains accessible
via the tagline's "browse folders" link.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 6, 2026

⚠️ No Changeset found

Latest commit: f2ddba6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Collaborator

@qxprakash qxprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing ! , I will ask @mifi to take a look into it.

role="tab"
tabIndex={0}
data-uppy-super-focusable
onClick={this.triggerFileInputClick}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having gone through the code now I suspect this was hardcoded because renderMyDeviceAcquirer can only allow one selection at a time , i.e. files or folders but can't handle fileManagerSelectionType: 'both' unlike renderDropPasteBrowseTagline which literally renders 2 buttons so in case of "both" it would render 2 buttons

one for selecting file and another for selecting folder and that this not possible for renderMyDeviceAcquirer because it's just a single button

Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly, it's not possible to support both; however, we can still support the folder selection. As you said, probably they put as hardcoded since it's not possible to handle both scenarios. But if we hardcode like that, we miss the folder option for no reason. In our application we needed folder option, that was the first reason I investigated this problem.

Comment on lines +111 to +114
const triggerMyDeviceInputClick =
this.props.fileManagerSelectionType === 'folders'
? this.triggerFolderInputClick
: this.triggerFileInputClick
Copy link
Copy Markdown
Collaborator

@qxprakash qxprakash Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good but because for the reasons which I described in
the previous comment it misses the the "both" case , so that might still be considered as a bug ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qxprakash , I also noticed it but it's impossible to handle both scenarios in one button. Even in the dashboard if you go with both option, then you need to put both buttons such as: browse files and browse folders.

@qxprakash qxprakash requested a review from mifi April 9, 2026 09:44
@EnverUsta EnverUsta requested a review from qxprakash April 13, 2026 20:02
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.

Dashboard: "My Device" ignores fileManagerSelectionType "folders" (opens file picker; browse link opens folder picker)

2 participants