chosen with bootstrap responsive

Created on 24 Jan 2013  Â·  10Comments  Â·  Source: harvesthq/chosen

I am using chosen with bootstrap responsive. when the browser window gets resized the chosen select elements remain the same size. has anybody implemented a solution for this?

Most helpful comment

As CSS with Bootstrap 3, you should add following lines to chosen.css file:

[class*="col-"] .chosen-container {
    width:98%!important;
}
[class*="col-"] .chosen-container .chosen-search input[type="text"] {
    padding:2px 4%!important;
    width:90%!important;
    margin:5px 2%;
}
[class*="col-"] .chosen-container .chosen-drop {
    width: 100%!important;
}

UPDATED:
I recently worked with Foundation 5 and here is my update to make Chosen works with Foundation 5 (it is more simpler):

.columns .chosen-container, .column .chosen-container {
    width: 100% !important;
    margin-bottom: 1rem;
}

All 10 comments

I did a quick css hack on it for one of my projects - https://gist.github.com/4627725

Thanks very much.

Tested on Android, iPhone, iPad, IE, Firefox, Chrome and Safari. All work a treat.

Cheers

@benblodgett your fix worked great with a little modifications. thanks, brilliant.

As CSS with Bootstrap 3, you should add following lines to chosen.css file:

[class*="col-"] .chosen-container {
    width:98%!important;
}
[class*="col-"] .chosen-container .chosen-search input[type="text"] {
    padding:2px 4%!important;
    width:90%!important;
    margin:5px 2%;
}
[class*="col-"] .chosen-container .chosen-drop {
    width: 100%!important;
}

UPDATED:
I recently worked with Foundation 5 and here is my update to make Chosen works with Foundation 5 (it is more simpler):

.columns .chosen-container, .column .chosen-container {
    width: 100% !important;
    margin-bottom: 1rem;
}

@datnguyen293 - could we maybe get that added to the original code? Cos that was a bugger for me - and now I found this, it REALLY helped! :+1:

Yes we can do bootstrap with chosen plugin. For tht u need to update ur css only.. if u want updated css for bootstrap purpose let me know..


On Wed 18 Jun, 2014 1:39 PM IST Andy wrote:

@datnguyen293 - could we maybe get that added to the original code? Cos that was a bugger for me - and now I found this, it REALLY helped! :+1:


Reply to this email directly or view it on GitHub:
https://github.com/harvesthq/chosen/issues/1004#issuecomment-46406958

Thanks @AnshuDahiya - I've already got it going myself - but I was just saying it would be a good idea to update the original BS hack for Chosen, so that it uses the latest code :) (I was using some code, that didn't respond when you resized the window - whereas with this code, it now does it perfectly =))

Yes, I think @youradds was right. If we can add these stuffs into Chosen's CSS that would be good. Other guys should not need to search for the solution and read through to this issue anymore.

Ok great.. 

Sent from Samsung Mobile

-------- Original message --------
From: Andy [email protected]
Date:18/06/2014 2:17 PM (GMT+05:30)
To: harvesthq/chosen [email protected]
Cc: AnshuDahiya [email protected]
Subject: Re: [chosen] chosen with bootstrap responsive (#1004)

Thanks @AnshuDahiya - I've already got it going myself - but I was just saying it would be a good idea to update the original BS hack for Chosen, so that it uses the latest code :) (I was using some code, that didn't respond when you resized the window - whereas with this code, it now does it perfectly =))

—
Reply to this email directly or view it on GitHub.

Works fu..ing loving great! Thanks @datnguyen293

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scottdoc picture scottdoc  Â·  7Comments

jim-at-miramontes picture jim-at-miramontes  Â·  4Comments

SFPink picture SFPink  Â·  4Comments

ali1360 picture ali1360  Â·  5Comments

asvetlenko picture asvetlenko  Â·  3Comments