Uncaught TypeError: $(...).once is not a function

Created on 12 July 2024, 5 months ago
Updated 27 August 2024, 4 months ago

Problem/Motivation

Following D10 upgrade work replacing jQuery.once with Drupal/once in https://www.drupal.org/node/3366097 one of the jQuery.once instances was missed.

The subsequent patch proposed in #8 🐛 jquery.once deprecated in D10 RTBC throws the error Uncaught TypeError: Selector must not be empty

This is a follow up issue (to https://www.drupal.org/node/3366097 ) to keep things consistent as different target version.

Steps to reproduce

  1. Install & enable the announce_autosubmit module
  2. Create a view with exposed filters and content to filter
  3. Open browser developer tools console
  4. Go to created view
  5. With a screen-reader active, change the exposed filters
  6. Console shows error and no announcement on change of view results

Proposed resolution

Update remaining jQuery.once to use Drupal.once with 'html' as target selector.
As per Change Record recommendations , window and document are not allowed with Drupal.once.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France waako Normandie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024