Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to have multi-line options? #532

Closed
cyberglot opened this issue Mar 21, 2014 · 8 comments
Closed

is it possible to have multi-line options? #532

cyberglot opened this issue Mar 21, 2014 · 8 comments
Labels

Comments

@cyberglot
Copy link

Hi folks,

I am in a need to build an select with multi-line options like that:

I've looked intro the examples and the issues and I didn't find a way to implement it. Is it possible?

Thanks.

@t0xicCode
Copy link
Collaborator

It's possible to implement using the data-content attribute: http://jsfiddle.net/t0xicCode/454Lqbz8/

@beanvonbaron
Copy link

Hi There,
I looked at that option but I am using an asp:DropdownList control for my project.
I don't know how I can use the data-content attribute when the values/options are created server side.
Any advice?
Here is an example of what I am looking for but again it's not using the dropdown controller. http://jsfiddle.net/ZTs42/2/

@EcoFreak
Copy link

EcoFreak commented Apr 4, 2017

I managed to fix this by adding this class large-bootstrap-select to the select that in turn is copied to the bs-container class.

<select class="selectpicker large-bootstrap-select" ....

It's important that the white-space rule is present because it changes how the li treats whitespace and in turn break the text.

.bs-container.large-bootstrap-select {
  .dropdown-menu {
    width: 500px;
    li a span.text {
      word-wrap: break-word;
      white-space: normal;
    }
  }
}

Before:

image

After:

image

Hope it helps

@rajupatel1000
Copy link

How to select box text show in 2 line?
Not working my css in ( Mozilla Browser )...But support in Chrome ...

MY CSS
select {
white-space: normal;
line-height: normal;
}

my select box images

@jesusgarza
Copy link

Seems that Multi-line options no longer works.
I tried the same fiddle, changed the file versions and it doesn't work.
http://jsfiddle.net/t0xicCode/454Lqbz8/

@caseyjhol
Copy link
Member

@jesusgarza Multi-line selects should now be working in v1.13.7.

@jesusgarza
Copy link

Great Casey, thanks!!

@ispweb
Copy link

ispweb commented Jun 13, 2023

I want to use multi-line with bootstrap-select, but when i select the option it should display the option value

<select class="selectpicker">
<option data-content="First Line<br>Second Line">Mustard</option>
<option data-content="House Number Street<br>City, State<br>Zip Code">Ketchup</option>
<option data-content="Single line address">Third Address</option>
</select>

So when i select "First Line<br>Second Line" the select should display : Mustard

Is this possible, didn't find a solution on internet jet.

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

No branches or pull requests

8 participants