Needs work
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2019 at 04:09 UTC
Updated:
25 May 2023 at 08:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andrewmacpherson commentedSee also #3027229: Modernize tabledrag accessibility.
Comment #4
mgiffordSo we could just use DrupalAnnounce() to tell the user what happened. Would that be sufficient?
Comment #5
rainbreaw commentedI think DrupalAnnounce() would be an excellent solution, as once you tab through the logic does become relatively clear.
The announcement would be something to the effect of
One other challenge is that the weight stepper fields do not have any label indicating what they are stepping the weights for. It would help if the filename were added, so that it would read something like
Comment #6
bnjmnmThis patch provides the functionality suggested in #5. An announcement is triggered when the show/hide weights is toggled, and the weight stepper field has a more descriptive label for screenreaders.
Comment #7
wim leersI'm surprised this is being added to the Media Library's code. We've got these weight toggles literally everywhere in Drupal's admin UI. Why aren't we doing it in a generic way, to solve this everywhere?
I can see either of these:
Comment #9
bnjmnm#7
no good reason - that's a much better way to go about this.
This new patch changes tabledrag and adds test coverage. No interdiff as it's a 100% different patch.
Comment #10
joachim commentedLooks like a good fix, but setting to needs work based on #7. This should be done for the tabledrag functionality in general.
Also, the issue summary doesn't explain what's being done here.
Comment #11
bnjmnmForgot to actually upload the patch in #9. Here's that, plus I updated the issue summary.
Comment #12
dwwMostly the patch in #11 looks good. A few concerns:
A) I'm not clear how to test this manually. ;) I don't have a screen reader. I'm not sure how to inspect the results of
DrupalAnnounce(). Any pointers on that?B) Patch #6 did this:
There's nothing like that in #11. Is it possible to have a general purpose solution for this, or would we have to change all the forms that make use of tabledrag?
That said, I'm not totally sure we need it. When inspecting the source for a tabledrag-enabled form in 8.9.x core with this patch applied, I'm already seeing this:
So we've got
<label for="edit-fields-title-weight" class="visually-hidden">Weight for Title</label>which seems like it should be sufficient for the concerns in #5. Did this label change in the last few months, do I misunderstand comment #5, or did #5 miss this markup somehow? Is it totally form-dependent? In my case, I'm looking at /admin/structure/types/manage/article/form-display -- I haven't dug into what layer in the system is handling that<label>.Finally, should we leave this tagged for needing a summary update until all the TODO is spelled out? Other than being slightly incomplete, the changes from #11 seem clear and good. I was going to remove the tag, but the TODOs made me think twice. ;)
Thanks!
-Derek
Comment #15
vsujeetkumar commentedRe-roll patch created for 9.1.x
Comment #17
vsujeetkumar commentedFixing test, Please review.
Comment #18
tanubansal commentedPatch #17 is working fine on 9.1
Comment #19
andrewmacpherson commentedI don't think this is a very good approach.
Drupal.announce()is a useful last resort for information which can't be conveyed any other way, but it isn't the first tool we should reach for. It comes with a major disadvantage; the user doesn't find out about the behaviour until after they have activated the control. Good controls inform the user of their purpose, state, and behaviour before you activate them.With patch #17 here:
Drupal.announce()says weights are now shown. No surprise there, it did what it said on the button.That doesn't add any clarity. It's just more words.
More importantly though, it still doesn't convey the entire behaviour of the button. The name of the button refers to the row weight fields, but it actually controls the behaviour of TWO things: the row weight fields, and the pointer drag-handles. The effect on the drag-handles isn't conveyed at all.
Another problem: it's a single button whose name changes. These aren't ideal, because they conflate the name of the control with the current state in a confusing way. When I encounter a button called "hide row weights", I have to do a mental hop to infer that the row weights are currently shown. The button name reflects the opposite of the current state. This problem is described by Leonie Watson describes in a webinar:
Source: How A Screen Reader User Accesses The Web (approximately 54 minutes into the video).
Compare this with some of the "toggle" buttons we have in Drupal core:
admin/configindex page, and the permissions page.role="switch"too.aria-pressed="true|false". This follows the suggestion from Leonie Watson's webinar, but it has more moving parts, and needs extra styling to convey the state to sighted users.<select>.aria-pressed="true|false"isn't sufficient to describe this behaviour.I propose that we change the row-weights button to a radio button group, to convey that 2 alternative tools are available.
I also think that our "show descriptions" toggle buttons could be improved by using checkbox semantics. We could to that in a separate issue, or expand the scope of this one. Thoughts?
Comment #25
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #26
mgiffordTagging for https://www.w3.org/WAI/WCAG21/Understanding/status-messages
Comment #28
Ratan Priya commentedRe-rolled #17 to 11.x-dev