todc / todc-select2

Google-themed fork of Select2. Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
http://todc.github.com/todc-select2/
Other
112 stars 17 forks source link

Select Multiple - selected option is not being removed #9

Open maheshthumar opened 11 years ago

maheshthumar commented 11 years ago

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!

todc commented 11 years ago

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.

maheshthumar commented 11 years ago

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

todc commented 11 years ago

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.

hekailiang commented 11 years ago

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

maheshthumar commented 10 years ago

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

Thanks.

Ricky-G commented 6 years ago

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