3
Good morning Guys,
I have a dropdown where I have several checkboxes contained in it. However when I click on any checkbox the dropdown selects only it and closes, I wanted to keep the dropdown open until I finish my choices.
Would that be possible? If so, how can it be done?
Dropdown:
$('#userList').append(
'<div class="custom-control custom-checkbox ml-2">'+
'<input type="checkbox" class="custom-control-input" id="'+data[i].id+'">'+
'<label class="custom-control-label" for="'+data[i].id+'">'+data[i].nome+' '+data[i].sobrenome+'</label>'+
'</div>'
);
Div from the Dropdown:
<div class='col-xs-12 col-sm-4 col-md-4 col-lg-2 dropdown'>
<button class="btn btn-info botao" type='button' id="user" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-users"></i></button>
<div class="dropdown-menu" aria-labelledby="user" id="userList">
</div>
</div>
Didn’t work :/
– Diêgo Correia de Andrade
would be able to post your dropdown code?
– Leonardo Getulio
Posted, used as id user, changed in tbm function and did not work
– Diêgo Correia de Andrade
Which version of bootstrap you are using?
– Leonardo Getulio
The version is 4.0.0
– Diêgo Correia de Andrade
test there without the append to see if it works, if yes later integrates the append.
– Leonardo Getulio
Also doesn’t work :/
– Diêgo Correia de Andrade
Diego, check here the snippet I posted. For reference I’m using Chrome on Windows.
– Leonardo Getulio
Man, I don’t know what’s going on 'cause I made an identity of yours and it didn’t work
– Diêgo Correia de Andrade
If running here in stackoverflow works? if yes can try to disable some JS library of yours to see if it is not influencing.
– Leonardo Getulio
I tested your example and tbm was not, now I have to find out which Bib is influencing this...
– Diêgo Correia de Andrade
Out that neither the checkbox appears here... With your application
– Diêgo Correia de Andrade
Let’s go continue this discussion in chat.
– Diêgo Correia de Andrade