Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292987

Drupal.announce debounce usage issue

$
0
0

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.


Viewing all articles
Browse latest Browse all 292987

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>