jquery.customSelect
jquery.customSelect copied to clipboard
Disabled class not changing after select's disabled property changes.
customSelect will set a class .customSelectDisabled on a select element that is disabled on initialisation. But it doesn't listen for changes in the disabled/enabled state and add/remove the .customSelectDisabled class accordingly.
It would be nice if it did.
Workaround: instead of using the handy CSS class shortcuts to style a disabled element, select it like so:
.hasCustomSelect:disabled + .customSelect { background:gray; }
Could be implemented using this: http://stackoverflow.com/a/8460497/421243
I have this problem too.
Thanks for the workaround @dacook works fine :D
Related to https://github.com/adamcoulombe/jquery.customSelect/issues/52
Warning for the workaround: if you have another script inserting elements in between your .hasCustomSelect:disabled and .customSelect, you may need to use the general sibling selector (~) instead. Eg:
.hasCustomSelect:disabled ~ .customSelect { background:gray; }
But be careful with it! It may select more than you bargained for.