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

Incorrect dropdown style when Bootstrap 4 version is not auto detected since 1.13.13 #2448

Closed
rjaros opened this issue Apr 26, 2020 · 6 comments
Labels

Comments

@rjaros
Copy link

rjaros commented Apr 26, 2020

When Bootstrap 4 version is not auto detected and is set manually with:

$.fn.selectpicker.Constructor.BootstrapVersion = '4';

the dropdown style is broken, probably because of this change: 8698d1b

version.major is still '3' when the default element template is generated.

@ShirleySunCN
Copy link

ShirleySunCN commented May 5, 2020

@caseyjhol I made some adjustment in my project to workaround this issue, I would like to ensure this is ok, please help to review it.
And hope for the next release, so great extension.

  .bootstrap-select > .btn{
    border: 1px solid #ced4da;
    background-color: white;
    width: 100%;
  }

  .bootstrap-select > .btn > div{
    float: left;
    width: 90%;
    text-align: left;
  }

  .bootstrap-select > .selectpicker {
    display: none;
  }

  .bootstrap-select > .dropdown-menu {
    padding: 0;
    max-height: 230px;
  }

  .bootstrap-select > .dropdown-menu > .inner > .dropdown-menu{
    top: 0;
    position: relative;
    width: 100%;
  }

Bug screen capture:
image

After modified the style:
image

@rjaros
Copy link
Author

rjaros commented May 5, 2020

To workaround this issue I'm inserting this small code fragment before loading bootstrap-select.js:

if ($.fn.dropdown === undefined) { $.fn.dropdown={'Constructor' : {'VERSION' : '4.0.0'}}; };

@ShirleySunCN
Copy link

@raido wow, thank you so much!

@raido
Copy link
Contributor

raido commented May 5, 2020

I am not sure I am tagged here correctly :).

@rjaros
Copy link
Author

rjaros commented May 5, 2020

Surely not :-) You are just first in github autocomplete list when someone writes @r ;-)

@caseyjhol
Copy link
Member

Released in v1.13.17!

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

4 participants