WICG / entries-api

Spec defining browser support for file/directory upload by drag-and-drop
https://wicg.github.io/entries-api/
Other
41 stars 9 forks source link

Behavior if both webkitdirectory and multiple attributes are specified #24

Open inexorabletash opened 6 years ago

inexorabletash commented 6 years ago

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.)

inexorabletash commented 6 years ago

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