todc-select2 icon indicating copy to clipboard operation
todc-select2 copied to clipboard

Select Multiple - selected option is not being removed

Open maheshthumar opened this issue 11 years ago • 6 comments

Hi Guyz, I am planning to transition from normal-bootstrap to TODC Bootstrap, and at the time of exploring select2 I've found that when multiple option is given, selected option is not removed from drop down!

maheshthumar avatar Jun 19 '13 12:06 maheshthumar

I'm not sure I understand. The multiple option for select2 isn't even supposed to produce a dropdown menu. You can find examples on the demo page:

http://todc.github.io/todc-select2/#multi

If you can provide some code or a jsfiddle I might be able to help more.

todc avatar Jun 19 '13 17:06 todc

Yes, I am referring to same example here in drop down (id="select2-drop-mask") when I select Alaska it should be removed from dropdown items, but it's not! Please refer Image hope it will make it more clear the issue. github select2

maheshthumar avatar Jun 20 '13 04:06 maheshthumar

Aha, I understand now. Thanks.

I'm guessing this was a recent feature/fix in the upstream select2 library. I'll take a look at pulling in those upstream changes sometime this week. In the meantime, you can try grabbing select2.js yourself at:

https://github.com/ivaynberg/select2

Unless they changed the CSS structure, it should be a drop-in replacement.

todc avatar Jun 20 '13 05:06 todc

Compared with ivaynberg's select2.css, I guess select2.css line 368 is not correct. It should be as following.

.select2-results .select2-selected { display: none; }

hekailiang avatar Nov 20 '13 03:11 hekailiang

Yes, Hekailiang I think you are right. Will try with that.

Thanks.

maheshthumar avatar Nov 29 '13 12:11 maheshthumar

Anyone still looking for this, the quick css fix is

.select2-results__option[aria-selected=true] { display: none; }

that will not display all previously selected items in a multi situation

Ricky-G avatar Jan 08 '18 02:01 Ricky-G