jquery.customSelect icon indicating copy to clipboard operation
jquery.customSelect copied to clipboard

Disabled class not changing after select's disabled property changes.

Open dacook opened this issue 11 years ago • 4 comments

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; }

dacook avatar Nov 19 '13 04:11 dacook

Could be implemented using this: http://stackoverflow.com/a/8460497/421243

dacook avatar Nov 19 '13 04:11 dacook

I have this problem too.

Thanks for the workaround @dacook works fine :D

felquis avatar Dec 11 '13 21:12 felquis

Related to https://github.com/adamcoulombe/jquery.customSelect/issues/52

dacook avatar Dec 19 '13 03:12 dacook

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.

dacook avatar Dec 22 '13 23:12 dacook