user-event icon indicating copy to clipboard operation
user-event copied to clipboard

upload() should support 'webkitdirectory' without 'multiple' being set

Open andrewalderson opened this issue 7 months ago • 0 comments

Problem description

The upload method doesn't support 'webkitdirectory' unless 'multiple' is also set to true. This is not the expected behaviour as selecting a single directory does not require 'multiple' to be set on the input.

Suggested solution

The upload method line 34 .slice(0, input.multiple ? undefined : 1) should be changed to .slice(0, input.multiple || input.webkitdirectory ? undefined : 1).

Additional context

No response

andrewalderson avatar Jul 05 '25 21:07 andrewalderson