I'm trying to get a multiselect selector from bootstrap-select in my dropdown from bootstrap 4. But every time I try to open the multiselect my dropdown menu closes and I can't figure out why this happens or how to prevent it. In the same dropdown menu I have a normal selector and that does the exact same thing.
<a data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">
<button style="margin-top: 10px; margin-left: 10px;" class='btn btn-success'>Nieuwe module</button>
</a>
<div class="dropdown-menu" style="margin-top: 25px !important;">
<div style="margin-left: 10px; margin-right: 10px;">
<h5 class="card-title">Nieuwe module toevoegen</h5>
<form action="modulemanager.php" method="post">
<div class="form-group">
<label>Termijn</label>
<select name="newtermijn" class="form-control">
<option value="0" selected>Eenmalig</option>
<option value="1">Per maand</option>
<option value="2">Per jaar</option>
</select>
</div>
<div class="form-group">
<label>Categorie</label>
<select name="newcat[]" class="selectpicker" multiple title="Kies categorieën">
<option value="0" selected>Eenmalig</option>
<option value="1">Per maand</option>
<option value="2">Per jaar</option>>
</select>
</div>
<button type="submit" name="add" class="btn btn-primary">Toevoegen</button>
</form>
</div>
</div>
I found this solution that made the normal select work but not the bootstrap-select dropdown