entries-api
entries-api copied to clipboard
Behavior if both webkitdirectory and multiple attributes are specified
Raised by @triblondon over in https://github.com/w3ctag/design-reviews/issues/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.)
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)