once() in responseLists causes JS error

Created on 18 April 2025, about 2 months ago

Problem/Motivation

at.responsiveLists line 46 has once() which no longer works in D10. This causes a JS error.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

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

Comments & Activities

  • Issue created by @John_B
  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)
  • 🇩🇪Germany christianadamski Berlin, Germany

    The solution is this:

    scripts/at.responsiveLists.js

    line first & last

    (function ($, Drupal, window) {
    })(jQuery, Drupal, window);
    

    to

    (function ($, Drupal, window, once) {
    })(jQuery, Drupal, window, once);
    

    line 46

    list.once().each(init);

    to

    $(once('at-responsive-list', list)).each(init);

    I can't provide patch or MR as the package.json toolchain doesn't work anymore and I can't minimize the JS with that.

Production build 0.71.5 2024