Problem/Motivation
After updating the Chosen module from version 4.x to 5.x using Composer:
the Simple Hierarchical Select: Chosen widget no longer works and throws a JavaScript error:
Uncaught TypeError: context.querySelectorAll is not a function
Reverting back to Chosen 4.x fixes the issue:
Steps to reproduce
1. composer require 'drupal/chosen:^5.0'.
2. composer require 'drupal/shs:^2.0'
3. Turn on modules ( you can install js library using command: drush chosenplugin)
4. Create taxonomy field reference and select Simple hierarchical select: Chosen widget.
5. On node creation form the field will not be visible and in console we get error
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2025-03-07 at 22.52.06.png | 203.16 KB | crafter | |
| Screenshot 2025-03-07 at 22.59.29.png | 58.48 KB | crafter | |
| Screenshot 2025-03-07 at 22.58.43.png | 314.16 KB | crafter | |
| Screenshot 2025-03-07 at 22.51.58.png | 129.21 KB | crafter |
Issue fork shs-3511731
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
crafter commentedComment #3
crafter commentedComment #5
crafter commented