Once is not well implemented

Created on 21 November 2022, almost 2 years ago
Updated 11 March 2023, over 1 year ago

Problem/Motivation

Reading https://www.drupal.org/node/3158256 , on document and window should not be used the events directly on it.
Example old way:

$(document)
  .once('off-canvas')
  .on();

Example new way:

// Can not use `window` or `document` directly.
if (!once('off-canvas', 'html').length) {
  // Early return avoid changing the indentation
  // for the rest of the code.
  return;
}
$(document).on();

Proposed resolution

Refactor the clientside validation javascript to follow the change record

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
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