Problem/Motivation
This is a followup of #2113931: File Field design update: Upload field.. When trying to implement the created file field designs we found that it was really hard to make that design accessible. It was decided to start over since new designs were already being worked on for the Claro theme. Finding how hard it was to make something accessible afterwards, we want to now start with created accessible markup for the field, and design from there.
Proposed resolution
Let's explore and create some beautiful markup.
We should also ensure that there is an alternative that doesn't rely on pointer interaction:
f the drag and drop element is implemented, then making sure that it is accessible to non-sighted and keyboard-only users is a must-have, not a should-have. In this case, this can simply mean bypassing the drag and drop interaction points entirely and moving a keyboard only user to the clickable upload button.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3064084
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wwalsh commentedAm working on this today at #design4drupal contrib day.
Comment #3
jacob@redfinsolutions.com commentedIn case it helps anyone or can work as a starting point here's the markup from the Drupal usability meeting on 06-25-19 (Demo starts here, about 38 minutes in: https://youtu.be/aipwkFhZDms?t=2265)
Comment #4
benjifisher@jacob.morin:
Thanks for transcribing that! The markup includes two variants of the upload form:
and
With suitable CSS, these look similar (as shown on the recording of the Usability meeting) even though the text "Add file" is in a
<span>element in the first variant, in a<label>element in the second element.I think the idea is that either one enables drag-and-drop, just using browser support of the
<input type="file">form element, and also a button that can be clicked (for those who do not like drag-and-drop).There are some differences between the two variants when using assistive technology. For instance, when someone uses voice control with the command "Click button", the assistive tech will place markers next to each button, and the placement of those markers will be different in these two implementations.
Comment #5
wwalsh commentedThis works!!
Comment #6
wwalsh commentedOK, this one ACTUALLY WORKS. A little old school javascript onclick in there.
Comment #7
mgiffordAre there other examples that you could draw from? Not sure who else has tried to address this problem outside of Drupal.
Comment #8
Sella Durai commentedneed to change a little design to looks good on ui part
Comment #9
xjmI wonder if the scope for this issue is too small? From #2834729-200: [META] Roadmap to stabilize Media Library:
So we need not only accessible markup, but also an accessible alternative for the whole interaction that works with keyboard or voice navigation, or for non-sighted users. It sounds like allowing users to bypass drag-and-drop entirely is more important (and maybe preferable). That's the approach we took with the Layout Builder "move block" functionality as well.
Expanding the IS and title to make sure we consider that as well.
Comment #13
andypostIt looks staled again
Comment #14
ambient.impactHas it gone bad already? I swear we just put it in the fridge.
Comment #20
shaalComment #21
mgiffordThanks for adding that @shaal.
I do think that there must be a reasonable solution to work for from that mix of links. Doesn't need to be perfect, but should be able to do up/down as well as left/right so that we can change order and hierarchy.