-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deselect and select option when using options with empty values #233
Conversation
+1 to both of these changes especially the ability to have clickable optgroups (sub select all options) via |
@@ -510,21 +521,25 @@ | |||
*/ | |||
createOptgroup: function(group) { | |||
var groupName = $(group).prop('label'); | |||
var inputType = this.options.multiple ? "checkbox" : "radio"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add a line like this:
$('label', $li).addClass(inputType);
since all the other labels have a class of 'checkbox' or 'radio', the optgroup ones should also. the CSS/spacing can be messed up without it.
+1 |
@svrin @MartinMartimeo actually this PR (which used to work great) is now having issues on the latest master (+ #259 merged in) - I get an error when using using one of the sub 'select all' options. Perhaps you could rebase? |
…n not changing state for an optgroup
They are now seperated into 3 own branches and rebased/merged onto the current head. They should now work again with the current version. |
Well, I will have a look. I skipped this the alst time as they were a lot of other (minor) fixes and issues I wanted to resolve first (more or less the same as this time, but I will try to understand the code and add it manually). Anyway, thanks for the work - great idea! |
When using option elements with empty values (like for example, having a selectAllValue = '') the select and deselect option did not work properly. I removed both checks that prevented the empty string from becoming a list.