At the moment we do something like select:visible ... this has problems with vertical tabs for example, as they are not visible immediately but they will be when the tab is selected. The other problem is that we never want date inputs to use the chosen selector (because it looks silly).

Maybe we should change our default selector to:
select:not([name*='day'],[name*='year'],[name*='month'])

Comments

aidanlis’s picture

This is what I'm using now:

select:not([name*='day'],[name*='year'],[name*='month'],[class*='block-weight'],[class*='region'], [class*='content-field-type-select'], [class*='content-widget-type-select'], [class*='content-field-select'], [name='vote'])

shadcn’s picture

I was wondering if we should not set a default selector? It is already causing some javascript conflict on the fields ui. now on dates fields. this might occur with more contrib as well. how about leaving it blank by default?

aidanlis’s picture

I think we need a field for whitelisting and a field for blacklisting, and we use that to generate some javascript. $(...).filter(...).chosen() style.

My list excludes:
- day/year/month fields on node/add and node/edit as it never makes sense and looks weird there.
- the block-weight on the blocks page - this should be all weight fields.
- the region on the blocks page.
- the D6 CCK UI fields
- The fivestar widget.

The same as the WYSIWYG module provides a whitelist/blacklist built in, I think we should probably do the same. One tricky bit is getting select:visible to work with vertical tabs.

What do you think? I guess it makes sense to do this in D7 and port backwards?

Cyclodex’s picture

Assigned: Unassigned » Cyclodex

For me this would be fine to have an exclude field too. This would be then just the part in the .not(...) yes ?

I am also thinking of attaching some information like the examples you put in this issue, so people see what could be done. What do you think ?

aidanlis’s picture

I've now swapped to whitelisting instead of blacklisting... it's a much simpler approach. Something like,

.view-xyz .views-exposed-filter select,
.vertical-tab-taxonomy select

etc.

andypost’s picture

This should be added to README - how to exclude date fields

Hydra’s picture

Status: Active » Fixed

I added the example for date fields to the README.txt. This should be enough I think. Perhaps on a later point we could provide a setting for such things, but I'm not sure this is really necessary.

Status: Fixed » Closed (fixed)

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

zilla’s picture

i think that aidanlis' snippet from #1 above should be included in the readme, particularly since SO many people use fivestar and are going to be wondering why the fivestars are suddenly displaying text below even when the option is disabled!

kopeboy’s picture

Issue summary: View changes

Please include some directions in the configuration page and complete documentation in the README!

I am having issues with the commerce price fields, which are not configurable in the Field UI.

Missing documentation: how to NOT apply chosen by ID in the configuration page?

Should I use select:not("#field_price[und][0][currency_code") ??

kopeboy’s picture

Title: Make the default chosen selector exclude date fields » Document ways of excluding chosen selector from the configuration page
Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Code » Documentation
Status: Closed (fixed) » Active

  • Hydra committed 4bf2c1d on 8.x-2.x
    Issue #1376710 by aidanlis: Make the default chosen selector exclude...
jasom’s picture

How to exclude chosen on certain selects:

https://www.drupal.org/node/2633466#comment-11037449