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

Option list is empty for bootstrap 4 #1745

Closed
Defcon0 opened this issue Jun 20, 2017 · 29 comments
Closed

Option list is empty for bootstrap 4 #1745

Defcon0 opened this issue Jun 20, 2017 · 29 comments

Comments

@Defcon0
Copy link

Defcon0 commented Jun 20, 2017

I did a simple HTML document with bootstrap 4 and the latest bootstrap select. The options list is empty then:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">

<link rel="stylesheet" href="dist/css/bootstrap-select.min.css">

    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<script src="dist/js/bootstrap-select.min.js"></script>
</head>
<body>

<form>
    <select class="selectpicker">
        <option>Option 1</option>
        <option>Option 2</option>
    </select>
</form>

</body>
</html>

screen

@projct1
Copy link

projct1 commented Jun 28, 2017

Yea, because .dropdown-menu is hidden by default :(
Also dropdown have wrong styles...
http://joxi.ru/BA04X5NtBMBoyA

@juliyvchirkov
Copy link

I've faced the same issue & after some researches I've got the theory that the primary source of that fault is the fundamental upgrade of the markup for dropdowns in bootstrap 4 (please take a look at the screenshot below)

2017-07-02 03 26 30

https://v4-alpha.getbootstrap.com/migration/

@caseyjhol
Copy link
Member

bootstrap-select does not yet support Bootstrap 4 (as it's still in alpha). Please follow #1135.

@krystyna93
Copy link

Hello caseyjhol,
Bootstrap 4 is now in beta version. Has this issue been resolved with a solution? I am having the exact same problem.

@ghost
Copy link

ghost commented Dec 26, 2017

Incompatibility still present December 26, 2017.
Some fix available on this ticket : #1135

@bartclaeys
Copy link

Incompatibility still present January 16, 2017.

@arpitux
Copy link

arpitux commented Feb 5, 2018

Incompatibility still present February 5, 2018.

@krystyna93
Copy link

Well, Bootstrap has now exceeded the Beta version, so its definitely high time to make it compatible now....

@caseyjhol
Copy link
Member

Bootstrap 4 support has officially been added as a part of v1.13.0-beta, available here: https://github.com/snapappointments/bootstrap-select/releases/tag/v1.13.0-beta. Please post any issues in that repo from now on.

@toho64
Copy link

toho64 commented Feb 14, 2018

Hi,
it doesn't work for me, see screenshots.
It doesnt't matter whether i have class="form-control selectpicker" or class="selectpicker"
Best,
Torsten

1
0

@caseyjhol
Copy link
Member

Can you link me to an example?

@toho64
Copy link

toho64 commented Feb 14, 2018 via email

@caseyjhol
Copy link
Member

@toho64 You're not loading the bootstrap-select CSS.

@toho64
Copy link

toho64 commented Feb 16, 2018

sorry, you're right. It works great now.

@mikalofy
Copy link

mikalofy commented Feb 21, 2018

Hi,
Why when I add option from ajax, it's refreshed and put the item but it appended too below the select ! Like as this sreenshoot

screen1
screen2

@caseyjhol
Copy link
Member

@mikalofy Please open a new issue: https://github.com/snapappointments/bootstrap-select/issues.

See guidelines for contributing.

Bug reports

A bug is a demonstrable problem that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

  1. Use the GitHub issue search. Check if the issue has already been
    reported.

  2. Check if the issue has been fixed. Try to reproduce it using the
    latest master or development branch in the repository.

  3. Provide environment details. Provide your operating system, browser(s),
    jQuery version, Bootstrap version, and bootstrap-select version.

  4. Create an isolated and reproducible test case. Create a reduced test
    case
    .

  5. Include a live example. Use this Plunker debugging template to share your isolated test cases. You can also make use of jsFiddle or jsBin.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? What would you expect to be the outcome? All these
details will help people to fix any potential bugs.

Example:

Short and descriptive example bug report title

A summary of the issue and the browser/OS environment in which it occurs. If
suitable, include the steps required to reproduce the bug.

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

<url> - a link to the reduced test case

Any other information you want to share that is relevant to the issue being
reported. This might include the lines of code that you have identified as
causing the bug, and potential solutions (and your opinions on their
merits).

@caseyjhol
Copy link
Member

Bootstrap 4 support has officially been added in v1.13.0!

@jeanmarc3
Copy link

I am trying to use this plugin with Bootstrap 4 (ASP.NET CORE / Razor) but get the same problem where there is an empty space when the dropdown is hovered on:

<select class="selectpicker"> <option>AAA</option> <option>BBB</option> </select>

image

This is what I am using:
`< link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.min.css" integrity="sha256-sJQnfQcpMXjRFWGNJ9/BWB1l6q7bkQYsRqToxoHlNJY=" crossorigin="anonymous" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.bundle.js" integrity="sha256-rZJJisswIJ6XB4c6vC5kGxApmapgl5U5bSDwCKerj3w=" crossorigin="anonymous"></script>

`

Any advice?

Also, how do you style the selectpicker dropdown so it matches the standard Bootstrap 4 controls (white background / blue highlight border on focus)? Thanks

@caseyjhol
Copy link
Member

@jeanmarc3 Please include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via Plunker, jsFiddle, CodePen or JS Bin, and report back with your link, Bootstrap version, bootstrap-select version, and specific browser and OS details.

@jeanmarc3
Copy link

I figured out that it broke because I had a different style defined as:

<style>
.dropdown:hover > .dropdown-menu {
display: block;
margin: 0px;
}
</style>

This style is used to automatically open other menu items on hover, but this breaks the selectpicker.
Also, maybe I am missing something but the selectpicker does not appear to be selectable by keyboard...

@dejooo13
Copy link

There is an issue when i click on select it doesn't show me dropdown with items. Any idea how to fix this?

@webexpert889
Copy link

Hi
I am using also same plugin but all the option is not showing, means my data is nore than 1000 but in the dropdown it is showing limited. Please see the screen shot

http://prntscr.com/lnvx17

@yrohit299
Copy link

I have the same issue as @webexpert889. Is this resolved? I have 1032 options but dropdown shows only limited ones.

@meJevin
Copy link

meJevin commented Apr 14, 2020

Having the same issue as @jeanmarc3. ASP.Net Core, Razor. Options are not showing. The version I am using is 1.13.9. This is what my head tag looks like:
`

<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>

<!-- Fontawesome-->
<link href="~/lib/fontawesome/css/all.min.css" rel="stylesheet" />

<!-- Roboto Font -->
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>

<!-- JQuery -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script>

<!-- Bootstrap 4.4.1 -->
<link href="~/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />

<!-- Bootstrap select -->
<link  rel="stylesheet" href="~/lib/bootstrap-select-1.13.9/dist/css/bootstrap-select.min.css"/>
<script src="~/lib/bootstrap-select-1.13.9/dist/js/bootstrap-select.min.js"></script>

<link rel="stylesheet" href="~/css/authorized/authroized.css" />
`

@caseyjhol
Copy link
Member

@meJevin Please try the latest release to see if your problem is resolved.

@meJevin
Copy link

meJevin commented May 20, 2020

@caseyjhol, the problem was solved!

@davidbuckleyni
Copy link

I am still having this issue in version

 <link rel="stylesheet" href="//unpkg.com/bootstrap-select@1.12.4/dist/css/bootstrap-select.min.css" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>

The menu options wont show for me the options just the first item
 

 
  |
 

@caseyjhol
Copy link
Member

@davidbuckleyni You're using bootstrap-select v1.12.4 CSS, which does not work with Bootstrap 4. Please ensure you are using the same version of CSS and JS.

@davidbuckleyni
Copy link

@caseyjhol Ok that worked but a new issue the dropdown is only showing the name part I am using asp.net core mvc and I have my results as a selectlist.

     <select asp-for="Enf_Cat"
             asp-items="@(new SelectList(ViewBag.UsersForSharingCase,"Value","Text"))" class="selectpicker">
            <option disabled>Share Case</option>
        </select>


    public void GetUsersForSharing() {
        string currentUser = GetCurrentTennantId().Result.ToString();

        List<SelectListItem> list = new List<SelectListItem>();
        var items = _context.Users.Where(sm => sm.Id != currentUser).ToList();
        foreach (var item in items) {
            list.Add(new SelectListItem { Text = item.FirstName + " " +item.LastName, Value = item.Id.ToString() });
        }
    
      ViewBag.UsersForSharingCase= list;

    }

As u see I told it to use text and value but when I look at the name html all i see is the name how is the id sent back using ur list ?. I should see the value somewhere to be able to catch it in the code behind in c# but I dont

image

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