bug js file:
core/misc/announce.es6.js
core/misc/announce.js
This file has the following bug code:
Drupal.announce = function(text, priority) {
// Save the text and priority into a closure variable. Multiple simultaneous
// announcements will be concatenated and read in sequence.
announcements.push({
text,
priority,
});
// Immediately invoke the function that debounce returns. 200 ms is right at
// the cusp where humans notice a pause, so we will wait
// at most this much time before the set of queued announcements is read.
return debounce(announce, 200)();
};
here "return debounce(announce, 200)();" , It's a misunderstanding of debounce ,
fixed to:
let announce_debounce = debounce(announce, 200);
Drupal.announce = function (text, priority) {
announcements.push({
text,
priority,
});
return announce_debounce();
};
Sign-offs needed
Regressions here would be serious. Manual testing with screen readers is important. Get sign-off from an accessibility maintainer.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 3061090-19.patch | 847 bytes | _utsavsharma |
| #19 | interdiff_d10.txt | 847 bytes | _utsavsharma |
| #13 | interdiff_10-13.txt | 624 bytes | vsujeetkumar |
| #13 | 3061090_13.patch | 1.14 KB | vsujeetkumar |
| #10 | interdiff_9_10.txt | 1.26 KB | anmolgoyal74 |
Comments
Comment #2
shreyal999 commentedWorking on its patch. Will update it soon.
Comment #3
shreyal999 commentedUpdated the JS script as per the description. Kindly review the patch and suggest changes if any.
Comment #4
andrewmacpherson commentedRegressions here would be serious. Before committing any change to the inner workings of Drupal.announce(), there should be manual testing with a range of browser/screenreader combinations.
Review of patch #3:
There's an ES6
letin announce.js - but that's supposed to be ES5, after compiling the ES6 file. Did you follow the process for working on core Javascript files? For instructions, see these links:Comment #8
nod_Comment #9
anmolgoyal74 commentedNot able to generate the interdiff.
Comment #10
anmolgoyal74 commentedComment #11
nod_Thanks for the patch!
This is getting in the way of the method documentation. It's better to place this before the comment of the
Drupal.announcemethod.Comment #12
nod_Comment #13
vsujeetkumar commentedUpdated patch according to the #11.
Comment #18
smustgrave commentedAppears to still need accessibility review.
Comment #19
_utsavsharma commentedPatch for 10.1.x.
Comment #20
smustgrave commentedMay be my limited javascript knowledge but how does one go about triggering this issue.
Since this was filed as a bug think it would be useful to have a test case that shows this issue.
Comment #22
mgiffordI'd need a lot more context and an example to be able to evaluate if this change caused any problems.
Comment #23
bnjmnmNo longer novice