Problem/Motivation

The Drupal Chosen 5.x version currently uses noli42/chosen library version 3.0.1 via composer.libraries.json. This version contains a bug that causes a JavaScript error in the browser console:

Uncaught TypeError: Cannot set property which of # which has only a getter
at s.mousedown_checker (chosen.min.js?v=3.0.1:1:11703)
at s.test_active_click (chosen.min.js?v=3.0.1:1:23064)
at HTMLDocument.click_test_action (chosen.min.js?v=3.0.1:1:1846)

This issue ( https://github.com/noli42/chosen/issues/6 ) has already been fixed upstream in a newer release of the noli42/chosen library:
https://github.com/noli42/chosen/releases/tag/3.0.2

Steps to reproduce

  1. Install Drupal Chosen 5.x
  2. Use a Chosen-enhanced select element
  3. Open browser console
  4. Interact with the select field and then move focus to the next field

Proposed resolution

Update the noli42/chosen dependency in composer.libraries.json to the latest available release that includes the fix.

Comments

fox mulder created an issue. See original summary.

nagy.balint’s picture

Hi!

We can do it, but likely better if this other issue is validated, as it is also related to the library.
#3513086: Chosen widget has no option to autosubmit when you select an item from the list of choices

  • nagy.balint committed 2bc867ac on 5.0.x
    feat: #3583580 Uncaught TypeError: Cannot set property which of #...
nagy.balint’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.