In #504378: Auto-save draggable forms I found out that:
After dragging a block to another section, we see the message:
* The changes to these blocks will not be saved until the Save blocks button is clicked.
I don't know for sure that this is in the drupal messages box, if not we'll update the issue title/summary.
I assume that where this is happening it is done in a standard way. I also assume that other modules might be adding messages to this/some other standard container with JS.
This causes problems for users of AT (primarily screen-readers and magnifiers) as they may not notice the dynamically added message.
WAI-ARIA provides a live region, which indicates to AT that they should monitor a region of the DOM for changes. We should add this to drupal messages and / or wherever this is commonly occurring. We should add with JS, as the problem will only occur w/ JS enabled.
| Comment | File | Size | Author |
|---|---|---|---|
| #79 | tabledrag-alert-1272990-79.patch | 1.37 KB | BarisW |
| #68 | Alert-for-weight-change.png | 33.93 KB | mgifford |
| #66 | tabledrag-alert-1272990-66.patch | 2.63 KB | droplet |
| #64 | tabledrag-alert-1272990-64.patch | 1.44 KB | mgifford |
| #62 | tabledrag-alert-1272990-62.patch | 1.51 KB | mgifford |
Comments
Comment #1
Everett Zufelt commentedComment #2
Bojhan commentedSubscribe, this would be awesome.
Comment #3
Everett Zufelt commentedCan someone tell me where class="js" is being added to
<html>? Would likely be best to add in the same spot, as part of the 'is JS enabled' test'.Comment #4
Everett Zufelt commentedUnfortunately this is not adding the message to a pre-existing container, but is inserting a container / message before the table:
/includes/tabledrag.js
Comment #5
Everett Zufelt commentedWhat needs to be done to resolve this is:
- An inline div needs to be inserted before the table w/ role="alert". This needs to happen when JS first modifies the table adding all the dnd handlers.
- Where the code is currently inserting the Save message before the table it needs to insert it as a child of the div added above.
Comment #6
Everett Zufelt commentedAlso just found out that the warning message isn't shown if 'show row weights' is enabled.
Comment #7
Everett Zufelt commentedComment #8
mgiffordThis sounds like a great contribution.
Comment #9
Bojhan commentedLets do this consistently in core, sounds like Everett outlined nicely what a patch would need to contain.
Comment #10
mgiffordAdding tag for WAI-ARIA.
Also, we need someone to roll the patch. Any takers?
Comment #11
mgiffordTagging... Also, tabledrag's moved to:
core/misc/tabledrag.js
Comment #12
mgifford@Bojhan do we have lists of places where there are interactive messages like in Drag/Drop?
I'd like to make this consistent, but not sure how many places this might be done in D8.
@Everett, I'm not sure this is what you were looking at but decided to start the ball rolling by simply adding role="alert" to the warning. The "Changed" note should also be explained I think but at the very least the text would need to change.
Comment #13
mgifford#12: aria2dragNdrop-1272990-12.patch queued for re-testing.
Comment #14
mgiffordJust needs a review it seems.
Comment #15
mgiffordThis is a pretty simple patch to review.. Only included the addition of:
role="alert"However, it might be better here to use
aria-live="polite":https://developer.mozilla.org/en-US/docs/Accessibility/ARIA/ARIA_Live_Re...
Either would be an improvement.
Comment #16
mgifford#12: aria2dragNdrop-1272990-12.patch queued for re-testing.
Comment #17
wim leersNote that the Edit module is already doing this! Thanks to jessebeach.
Comment #18
jessebeach commentedIf this patch solves the acute issue, I say we commit it for the addition info it provides.
We've got custom implementations of aria-live in Edit and Toolbar. Frankly, any UI I touch going forward will get aria-live messaging because, well, that's what building a UI is all about - making the state of the application known.
After feature freeze I'd like to consolidate the Toolbar and Edit module area-live implementations into a common implementation under something like
Drupal.inform. There's no reason to hold a quick fix for a bigger fix, though.Comment #19
jessebeach commentedComment #20
webchickCommitted to 8.x, thanks! Will push in a few mins.
Wonder if this is worth a backport to D7.
Comment #22
mgiffordRealized there's a problem with the approach taken here for Safari & IE9.
Looking forward to @jessebeach's API #1915302: Provide an API for aria-live region update announcements that module developers may leverage which should provide a standardized way to do this.
Comment #23
mgiffordRough patch to use Drupal.announce function. We still need role="alert", but can't count on it to announce it to AT.
Comment #24
wim leersYou're returning before
Drupal.announce()is called; hence it won't be called :)Comment #25
mgiffordRight.. Thanks Wim. Juggling a few things today and missed that obvious one. Have to do local testing too.
Comment #26
mgiffordOk, I'm getting a bit further with this, but still getting:
Uncaught TypeError: Object #<Object> has no method 'announce' tabledrag.js:1248I'm not sure why this isn't working
Drupal.announce(changeWarning, 'assertive');Comment #27
mgifford#26: Drupal.announce-function-dragNdrop-26.patch queued for re-testing.
Comment #28
wim leersSounds like a JS lib dependency problem: it seems Drupal.announce is loaded after the calling code.
Comment #29
skilip commentedDrupal.announce is part of drupal.js, which is loaded before tabledrag.js, so that shouldn't cause any troubles. Maybe use window.Drupal.announce() instead? Or wrap tabledrag code like this?
Comment #30
mgiffordWell, we can try it.
Comment #31
mgiffordWell, the patch works in SimplyTest.me, but not for VoiceOver based on my testing.
Drupal.announce(changeWarning, 'assertive');
I'm not seeing what I'd expect from: #1915302: Provide an API for aria-live region update announcements that module developers may leverage
Comment #32
jessebeach commentedIn this case, I think you added code to the tabledrag.js
tableDragChangedWarningmethod, but this method is overridden inblocks.js, which is probably why you weren't hearing the announcement. That's my guess in any case.mgifford, do we need
Drupal.announcehere? Shouldn't therole="alert"attribute be sufficient to get the warning message read? That's what I did in this patch, with some cleanup of the strings. If we really do needDrupal.announcehere, let me know and I'll update it or I'm glad to review an update if you want to do it.Comment #33
mgiffordIt should have been enough, but in testing this in Safari with VoiceOver I realize I didn't see it. Searched found http://blog.paciellogroup.com/2012/06/html5-accessibility-chops-aria-rol...
Thought we could use the Drupal.announce approach here instead:
https://drupal.org/node/1272990#comment-7063974
It works as expected in ChromeVox. Just tested just now.
EDIT: Patch above doesn't seem to get VoiceOver to work in Safari either unfortunately.
Comment #34
jessebeach commentedIt's a pity that Safari doesn't support
role="alert"! Oh well, I'll put theDrupal.announceback in that you originally had.Comment #35
jessebeach commentedmgifford, I made some changes to
Drupal.announceto deal with the Overlay. VoiceOver and ChromeVox don't seem to be reading aria-live element changes that occur in nodes inside of iframes. So we always need to be manipulating the live element in the parent window.Let me know if this patch works for you in Safari. The tabledrag.js warning is not quite working correctly yet. If you navigate from the Blocks page to a Content type field display page and alter the table, it will read the warning from the Blocks page. We need to be passing the text for the warning into the theme function, rather than simply including the text in the theme function.
Comment #36
mgiffordThat worked great in Safari/VoiceOver. Thanks for re-rolling the patch.
Comment #37
mgiffordWhere are we at with this patch? What else needs to happen before we let the bots at it.
Comment #38
jessebeach commentedmgifford, this is the one piece we need to address:
Comment #39
jessebeach commentedIt "works" right now, but you navigate around the Overlay, you can end up getting the wrong message across pages that use the Drag-drop warnings. Whatever the first message you get is, that's the one you'll have for the rest of your overlay session.
Comment #40
mgiffordOk, thanks for the update. I was just trying to touch on some of the issues that have dropped a bit lower in the priority list over the past month.
Comment #41
mgifford#35: tabledrag-alert-1272990-35.patch queued for re-testing.
Comment #43
mgifford@Jesse, can re-roll this patch?
Comment #44
jessebeach commentedThis is just a straight reroll on D8:60a1055049ac218322c09b9bd753289ac39a2259. I don't have time to fix the issue I mentioned in #39 right at the moment.
Comment #45
mgiffordWant to see if #44 runs into problems with the bots.
Still have to deal with #39 as @jessebeach says.
Comment #47
mgiffordReroll with visually-hidden...
Comment #48
mgiffordGo bot.
Comment #49
mgifford#47: tabledrag-alert-1272990-47.patch queued for re-testing.
Comment #50
mgifford47: tabledrag-alert-1272990-47.patch queued for re-testing.
Comment #52
mgiffordjust a re-roll.
Comment #53
Jalandhar commentedComment #54
mgiffordThanks for finding that @Jalandhar.
Comment #55
jhedstromPatch in #54 still applies. Adding the manual testing tag.
Comment #58
nod_Comment #59
mgiffordComment #60
mgiffordOh ya, this should be basically identical to the last one. Just a bit of fuzz:
patching file core/misc/tabledrag.js
Hunk #1 succeeded at 1277 with fuzz 1 (offset 16 lines).
patching file core/modules/block/js/block.js
Hunk #1 succeeded at 132 (offset 1 line).
Comment #61
nod_We can drop the parent.window thing. No overlay anymore.
Comment #62
mgiffordThat makes it simpler. No need to modify core/misc/announce.js then, right?
Comment #63
droplet commentedredundant comments
Comment #64
mgiffordOk, I removed that line from core/modules/block/js/block.js
Comment #66
droplet commentedWe should not replace the Drupal.theme.element globally.
Passing var in patch still not ideally way, but sadly there's limitation on Drupal.theme().
Comment #67
mgiffordWhat does the bot think of this new patch?
Comment #68
mgiffordI've tested this in ChromeVox & looked at the page source. Drupal.announce is being properly presented.
I think this is good to go.
Comment #69
alexpottShould we just have a (documented) var on the tabledrag object which defaults to
'tableDragChangedWarning'Comment #70
mgiffordComment #71
jessebeach commentedI'm unsure why we'd insert an element with warning text in a div with
role=alertand also invokeDrupal.announce. I presume this would result in the message getting announced twice. But then,role=alertdoesn't have great support. So maybe it's a valid hedge.Comment #72
mgiffordComment #73
andrewmacpherson commentedComment #78
andrewmacpherson commentedI think comment #69 is still an issue to look at?
Comment #79
BarisW commentedSo I tested the patch on both ChromeVox and Voiceover. In ChromeVox it works fine, in Voiceover I don't hear the message announced. Either way, I get the same results for the version with and without
role=alert. I would suggest to remove therole=alertsince the Drupal announce already reads the text.Comment #80
andrewmacpherson commentedOK, that sounds good to me.
Support for
aria-live="assertive"varies between different screenreaders (androle="alert"is supposed to implyaria-live="assertive").It sounds like we have run into that problem, and we can't fix it in Drupal. Instead, by avoiding
role=alertwe can get the Drupal.announce() message instead.Comment #81
mgiffordWhat else do we need to do before marking this RTBC? This sounds like the right direction to go.
Andrew, have you tested this code independently? If not, I guess that's the next step.
Comment #82
Bojhan commentedI dont fully understand why we are doing "Make tabledrag warning message show when row weights are enabled"
Comment #85
mgifford@Bojhan I'm confused by your response.
Does the issue need a clearer description?
We need to use Drupal.announce() to tell screen readers that this text has appeared on the page.
Comment #87
Bojhan commentedYes, but it doesn't need to be displayed right?
Comment #88
mgiffordI agree @Bojhan there should be no visible changes. Just WAI-ARIA.
Comment #96
lendudeUpdating the title to better match the direction of the discussion and the fix, feel free to tweak further.
This now seems to come down to support for role="alert" vs using Drupal.announce. The role="alert" change landed in #20.
We are almost 10 years on from when this landed, is support for this still lacking, or are we okay now with relying on role="alert"?
Comment #97
quietone commentedI'm following up issues that were committed and then re-opened. In Bugsmash, we found that such issues tend to linger. Therefore I am restoring the title on this and making a followup with the new title (thank you lendude).
The followup issue is #3279596: Announce tabledrag warning message to Assistive tech.
Therefore restoring the fixed status on this issue.