-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Duplicated options in different optgroups doesn't render correctly #1128
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
Conversation
Changes Unknown when pulling a2143c7 on zeitiger:brokenOptgroupDuplication into * on selectize:master*. |
Thanks for the PR. If I'm not mistaken that should be part of the wider improvement that duplicate values should be allowed regardless of optgroups (see #129). Sounds like those two should probably go hand in hand. |
I believe that is a simple bug, because the complete preprocessing of optgroup and option within // if the option already exists, it's probably been
// duplicated in another optgroup. in this case, push
// the current group to the "optgroup" property on the
// existing option so that it's rendered in both places. and also another test case give me the hint it('should allow for values optgroups with duplicated options', function() { but that fall short, because the DOM works different as expect for the original author within rendering step. The issue want a change within the data processing step before the rendering. If you want that that you have to change the internal data structure, that will be a much bigger refactoring. IMHO my pull request is as render bug fix independent of data processing change request |
This already existing example ( <div class="demo">
<h2>Optgroups (repeated options)</h2>
<div class="control-group">
<label for="select-repeated-options">Options:</label>
<select id="select-repeated-options" class="demo-default" multiple>
<option value="">Select...</option>
<optgroup label="Group 1">
<option value="a">Item A</option>
<option value="b">Item B</option>
</optgroup>
<optgroup label="Group 2">
<option value="a">Item A</option>
<option value="b">Item B</option>
</optgroup>
</select>
</div>
<script>
$('#select-repeated-options').selectize({
sortField: 'text'
});
</script>
</div> |
191c94a
to
81bbdc4
Compare
I made an entry in the changelog and rebase this pull request to make it easier to merge :-D |
I will check it out, thanks @zeitiger |
81bbdc4
to
59a3e4a
Compare
Same problem here, still not merged yet! |
If I could get a rebase on master, I'd be inclined to merge. |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Duplicated options (options with the same value) will be render only once within last occurrence
This pull request includes a test case to reproduce the problem and the bugfix for that. I'm open for discussion to make this bugfix better :-)
Have a nice day 😸