Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior if both webkitdirectory and multiple attributes are specified #24

Open
inexorabletash opened this issue Jan 19, 2018 · 1 comment

Comments

@inexorabletash
Copy link
Collaborator

Raised by @triblondon over in w3ctag/design-reviews#215

What is the behavior if <input type=file webkitdirectory multiple> is used, i.e. if both webkitdirectory and multiple attributes are specified? Does one attribute override the other, or can multiple directories be selected?

The current behavior in Chrome is that webkitdirectory overrides multiple, and the latter has no effect. Only a single directory can be selected. I have not yet tested other implementations.

This should be specified somewhere. (Presumably in HTML eventually, but here for now.)

@inexorabletash
Copy link
Collaborator Author

inexorabletash commented Nov 9, 2018

Clicking on an input control generated via:
document.body.appendChild(Object.assign(document.createElement('input'), {type: 'file', webkitdirectory: true, multiple: true}))

  • Chrome (70): multiple has no effect
  • Firefox (63): multiple has no effect
  • Edge (17): multiple has no effect
  • Safari (11.1): multiple directories can be selected, the webkitRelativePath for each file includes the selected directory containing it (e.g. audio/1.mp3, images/2.png, etc)

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

No branches or pull requests

1 participant