diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index 7055df413..ebb7f1699 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -2663,6 +2663,10 @@ that.createView(false); } + // toggle to close the dropdown if it is currently open + if (version.major > 4 && that.$menu.hasClass(classNames.SHOW)) { + that.$menu.removeClass(classNames.SHOW); + } } this.$button.on('click.bs.dropdown.data-api', function (e) { diff --git a/tests/bootstrap4.html b/tests/bootstrap4.html index 282800c00..cc2022df9 100644 --- a/tests/bootstrap4.html +++ b/tests/bootstrap4.html @@ -326,6 +326,19 @@ + +