Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Make chosen look like Bootstrap input #286

Closed
robinpoort opened this issue Dec 7, 2015 · 9 comments
Closed

Make chosen look like Bootstrap input #286

robinpoort opened this issue Dec 7, 2015 · 9 comments
Assignees
Labels
Milestone

Comments

@robinpoort
Copy link
Contributor

https://fk.github.io/select2-bootstrap-css/

@robinpoort robinpoort assigned tomjanssens and unassigned tomjanssens Dec 7, 2015
@johanjanssens johanjanssens added this to the 1.1 milestone Dec 9, 2015
@johanjanssens
Copy link
Member

@robinpoort Is this something that you can get in for the 1.1 release or too much work ?

@robinpoort
Copy link
Contributor Author

@johanjanssens It should be as easy as adding the CSS and add a setting to each select2 instance. This is working for select2 versions 3.3.2 and 3.4.1 at least (http://t0m.github.io/select2-bootstrap-css/3.3.2.html). Probably for other versions as well.

Want me to check this out and try to implement this?

@johanjanssens
Copy link
Member

@robinpoort Yes please can you handle this ?

@robinpoort robinpoort changed the title Make select2 look like Bootstrap select Make chosen look like Bootstrap input Mar 9, 2016
robinpoort pushed a commit that referenced this issue Mar 9, 2016
@robinpoort
Copy link
Contributor Author

@johanjanssens Fixed this in branch 286. Since it's the platform I had to style the chosen selectboxes instead of select2 since Joomla is using chosen by default. Luckily there was also a GH Repo for chosen Bootstrap styling. I had to customize it since Joomla changed all class names to chzn though.

Tested on latest: Chrome, Safari, Firefox, Opera and IE Edge

The whole platform could use some love on IE11 and down but I guess we're not developing for these broswers? Focusing on Chrome and Firefox mainly?

@johanjanssens
Copy link
Member

@robinpoort Good work. Tested and everything looks great. I did notice that all the select boxes are stretching max width ? Is that the intend ?

@robinpoort
Copy link
Contributor Author

@johanjanssens That was already the case when I started :)

I can probably make them smaller by default if you want to? (Not sure tho since JS is attaching style="width:xxx;" to the element as well.)

@johanjanssens
Copy link
Member

@robinpoort For some pages these things are really long. What do you suggest ?

@robinpoort
Copy link
Contributor Author

@johanjanssens They are as long as the regular inputs right? I would keep it this way for now. If we give them a set width they might look weird on some resolutions. For example if the text inputs are always 100% wide and the select2 isn't, then for example the text input could be 450px on certain resolution whole the select2 is 440px. That would look like a styling bug while it's not. If we decide to make them smaller I'd make everything smaller.

But then if it smaller while the content inside it is wider, you get inline scrolling in the text input and not fitting items in the select2 dropdown.

Long story short, keep it as is or throw some good hours to it to find a decent solution (probably having to add some JS as well)

@johanjanssens
Copy link
Member

Agreed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants