Closed modean closed 1 year ago
currently the validation occurs on the drop event
cc @carbon-design-system/design what should the UX look like if the uploader has multiple file uploads enabled and the user tries to drag a group of files which contains an unaccepted file type? should the entire operation be blocked? currently we allow only the valid files through and reject the invalid files, and we do not make any changes to the cursor
I think we should allow all files to be passed through even if they are going to load as invalid. (even if its a group of files at a time). I think this is better communication to the user what is happening to their file, rather than blocking it from showing up. Blocking it can seem like some kind of bug happened with the file uploader itself.
@laurenmrice
[...] rather than blocking it from showing up [...]
I agree on one hand but on the other hand seeing the green plus icons for files that are not accepted instead of the not allowed icon at least to me was equally confusing. What I do not know is whether peeps are commonly used to this pattern of an overlay icon that provides a visual cue to the user or not.
I also have to admit that I did implement DnD patterns on my own in the past so I might be more familiar with these overlay icons than the regular end user.
@laurenmrice
[...] rather than blocking it from showing up [...]
Also as mentioned above in one of my remarks, my main intent was to make the DnD interaction pattern consistent with the behaviour of the file chooser interaction pattern.
There if you click on the dropzone instead of dropping a file you get the native file chooser as exposed by the user agent (browser). Due to the accept
property being set file types that are not allowed are greyed out. The user would not be able to select them and thus the user does not get any feedback on what is going on.
Thus in our product we decided (and I as well saw that in the Carbon guideline) to always put an explanatory tagline atop of the dropzone that calls out the file limitations that are imposed onto the user by the dropzone. That way the user can make an informed decision and would know why he/she would get the not allowed icon or why files in the native file chooser widget are greyed out.
After all I can also imagine that the native file chooser widget is the interaction pattern that is the preferred interaction pattern but I guess that requires user research (I do not think we instrumented our product so that we would have metrics about which interaction pattern is more frequently used).
During DnD operations files that are not allowed have a green plus overlay icon instead of the not-allowed overlay icon
Environment
Detailed description
Note: As a reference the native file chooser widget can be used that you get when you click on the drop area. Due to
accept
being set to{[".txt"]}
the file chooser widget of the user agent (browser) would not allow you to select.png
files. Instead these files are greyed out. Thus the behaviour of the DnD operation and there its overlay icon should be symmetric. That is it also should indicate what is possible and what not by using the appropriatedropEffect
and thus the appropriate overlay icon.Steps to reproduce the issue
FileUploaderDropContainer
accept
to{[".txt"]}
Additional information
Original Slack Convo:
See also:
https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/FileUploader/FileUploaderDropContainer.js#L78
https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
https://watsondataplatform.slack.com/archives/C2K6RFJ1G/p1585042290082800