Answer the question
In order to leave comments, you need to log in
How to get around trouble with opening bootstrap-select in bootstrap dropdown?
Look guys, I have a dropdown with bootstrap, I have a select customized into it through the bootstrap-select lib, and I have a problem, this select does not work out the norms, since we get this select is also done through the bootstrap dropdown, in general, I solved the problem so that the parent dropdown does not close and works inside the select like this:
$('[sub-dropdown]').on('click', function (e) {
var target = $(e.target),
$parent = target.parents('.bootstrap-select');
if ($parent.length) {
$parent.toggleClass('show');
$parent.find('.dropdown-menu').toggleClass('show');
$parent.find('select').selectpicker('refresh');
e.stopPropagation();
e.preventDefault();
} else {
$parent.removeClass('show');
$parent.removeClass('.dropdown-menu')
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question