Use context in once in dropdown-widget.js

Created on 10 September 2025, about 1 month ago

Problem/Motivation

In dropdown-widget.js, the makeDropdown function calls once() without passing the context.

$(once('facets-dropdown-transform', '.js-facets-dropdown-links')).each(function () {

This can cause problems in environments with BigPipe/Ajax. I'm dealing with an intermittent bug on a site now, where sometimes selecting a new option automatically triggers, sometimes it doesn't. I haven't been able to pin down exactly how this is caused, but I suspect it's related to this code not using context with once.

To fix, add context in the once call:

$(once('facets-dropdown-transform', '.js-facets-dropdown-links', context)).each(function () {

I'm not 100% certain this will address what I'm seeing, but it seems like a probably culprit. I'm not certain how much using context here is a "best practice"

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bburg Washington, DC

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

Merge Requests

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