select2 / select2-bootstrap-theme

A Select2 v4 Theme for Bootstrap 3
https://select2.github.io/select2-bootstrap-theme/
MIT License
871 stars 498 forks source link

Adding .input-sm class, and containerCssClass: ':all:' doesnt work for me #49

Closed matiazar closed 7 years ago

matiazar commented 8 years ago

Im using select2.full.js Select2 4.0.3 and Css 0.1.0-beta.8

I put this on select2 config but the select box doesnt open. doesnt show the options containerCssClass: ':all:'

the problem that I found is that select has a class called "select2" so when document loads $(".select2").select2({ width: '100%', placeholder: function(){ $(this).data('placeholder'); }, containerCssClass: ':all:', }); it copies the select2 class to the container and that makes all broken. there is another way to make this without the :all: class ?

on the examples page, this is not happening. Why ? Thanks !!!

kctech commented 8 years ago

I had the same issue - make sure you're using select2.full, like the examples - and this will work

matiazar commented 8 years ago

i had to change the .select2 class to .select2b for this to work

radiok commented 5 years ago

This might be so much noise on a dead thread, but I used "select2" as my class to initialize the select2 controls on, and that was fine, right up until I set the containerCssClass to ":all:". It was at this point it applied a "select2" class to the select2 container and broke things. @matiazar's answer didn't make sense initially but once I played with it, it made total sense.