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

Word wrapping on data-subtext if the text is too long #1757

Open
bhritch opened this issue Jul 3, 2017 · 5 comments
Open

Word wrapping on data-subtext if the text is too long #1757

bhritch opened this issue Jul 3, 2017 · 5 comments

Comments

@bhritch
Copy link

bhritch commented Jul 3, 2017

No description provided.

@bartclaeys
Copy link

bartclaeys commented Sep 18, 2018

Same problem here in v1.13.1, when adding subtext that is really long, the dropdown menu becomes too wide and the text does not wrap when exceeding the selector's width. I've tried to set data-width attribute, but that doesn't affect the dropdown menu. Spent several hours to implement a hack to get this fixed, but nothing seems to work so far.

screen shot 2018-09-18 at 3 54 10 pm

@bartclaeys
Copy link

Fixed (but it's a hack):

.bootstrap-select .dropdown-menu {
	width: 100%;
}

.bootstrap-select .dropdown-menu li small {
	white-space: normal;
}

@dongloo
Copy link

dongloo commented Jun 24, 2021

Fixed (but it's a hack):

.bootstrap-select .dropdown-menu {
	width: 100%;
}

.bootstrap-select .dropdown-menu li small {
	white-space: normal;
}

if fix by this way, data-size not working

jadinm added a commit to jadinm/simulacres-dynamic-sheet that referenced this issue Sep 15, 2021
@Bogatinov
Copy link

Bogatinov commented Jun 10, 2022

Hey, sorry for opening an old issue @caseyjhol, can you assist me on how to use v1.13.18 with

  1. white-space or any other way to cut long text in <option>
  2. without extra space at the bottom

white-space: normal; seems to work for v1.12, however it does add extra space in v1.13.18 when opening the menu.
image

Thanks in advance 😃

Configuration

Most basic dropdown configuration

$element.addClass('selectpicker').selectpicker({
    container: 'body'
});

with the custom rule for the white-space

.bootstrap-select .dropdown-item {
    white-space: normal;
}

which affects the dropdown height

<div class="dropdown-menu open">
    <div class="inner open"> <!-- 145px height, because of min-height -->
         <div class="dropdown-menu inner"> <!-- 76px height, exactly as necessary -->
             <ul class="dropdown-menu inner">
                 <li class="selected active">
                       <a class="dropdown-item"> <!-- wrap long text with white-space -->
                  </li>
             </ul>
         </div>
    </div>
</div>

Versions

Lowest stable is 1.13.12.

References

I went through all options, there isn't any to "handle" the algorithm for the Height of .dropdown-menu
https://developer.snapappointments.com/bootstrap-select/options/

@nativ69
Copy link

nativ69 commented Nov 28, 2022

upvoting for @Bogatinov request

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

No branches or pull requests

5 participants