Drupal.announce debounce usage issue

Created on 12 June 2019, over 5 years ago
Updated 6 June 2023, over 1 year ago

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.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Javascript 

Last updated 5 days ago

Created by

🇨🇳China yunke

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Needs accessibility review

    Used to alert the accessibility topic maintainer(s) that an issue significantly affects (or has the potential to affect) the accessibility of Drupal, and their signoff is needed (see the governance policy draft for more information). Useful links: Drupal's accessibility standards, the Drupal Core accessibility gate.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024