Closed (fixed)
Project:
Chosen
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2013 at 12:30 UTC
Updated:
18 Mar 2014 at 23:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tymn commentedI'm also experiencing this issue with the latest recommended and dev releases. As well as 'search in the middle' not working it was also not using my custom placeholder text. I've reverted back to the previous version I was using (7.x-2.0-alpha2+13-dev) which is working fine.
Comment #2
miroslavbanov commentedThe bug is that widgets do not receive the settings/options of chosen.
Problem was introduced with this commit https://drupal.org/comment/7876589#comment-7876589
of this patch https://drupal.org/comment/7861437#comment-7861437
The settings/options had to be applied for every matched select, but there are two selectors in the chosen js behavior.
Attached is a patch that resolves the problem, without duplication of code.
Comment #3
maximpodorov commentedThe correct fix.
Marking my issue as duplicate: #2170113: Options for widgets are lost
Comment #4
maximpodorov commentedAny plans to accept this patch?
Comment #5
maximpodorov commented@Dave Reid, excuse me for the annoyance, do you think it's a right fix?
Comment #6
dave reidI think it does although the way it is implemented as a var which is a function doesn't actually seem correct.
Just looking at the code, I don't understand why we can almost have a complete options object provided in Drupal.settings.chosen, and use that rather than having to 'construct' it every time.
Comment #7
maximpodorov commentedIt's because of 'width' parameter (part of options) which is calculated for every element separately.
Comment #8
dave reidSo we were a little on the right track with having a function to get the options, but I improved it a bit more. All of the default options are not contained in Drupal.settings.chosen.options. I've tested this and it seems to work much better and helps simplify stuff that needs to be applied to every chosen element (like minimum width calculation).
Comment #9
dave reidComment #10
dave reidForgot inherit_select_classes...
Comment #11
dave reidTested and committed #10 to 7.x-2.x: http://drupalcode.org/project/chosen.git/commit/3816a20
Comment #12
maximpodorov commentedThanks. Chosen is usable now.