Hi,

Not sure if I am missing something, but I cannot get this to work in my frontend. I works perfectly on all admin pages, but then when I view pages with forms (I use webforms) the module does not work.

When looking at the source, I see that none of the js or css is loaded.

I have also tried loading the library manually adding
drupal_add_library('chosen', 'drupal.chosen');
to my template.php. This adds the js and css but now I get an error in the console

TypeError: multiple is undefined
if (multiple[name] !== false) {           line 32 chosen.js

any help is appreciated

Comments

rooby’s picture

Issue summary: View changes

I am also seeing errors when using in the front end, although I'm not sure if it is exactly the same issue or not.

I am getting this error (non-minified version line number):

TypeError: this.form_field.options is undefined
chosen/chosen.jquery.js?v=1.1.0
Line 829

Currently I am also on alpha4 due to the distro I am using but I will try to get some time to test with a newer version also.

MXT’s picture

I have the same issue with Drupal 8 version.

Forcing loading of chosen library in frontend theme adding it in mytheme.info.yml:

libraries:
  - mytheme/global-assets
  - chosen/drupal.chosen

works correctly (the chosen functionality I mean) but chosen css are not loaded.

safetypin’s picture

This appears to still be a problem.

From what I can see, the css file in the module is being included, but it's not attaching all the css from the chosen library. I tried adding chosen_lib/chosen as a dependency and that didn't work either.

Actually, I'm working with the Drupal 8 version...