Skip to content

Commit 81205fc

Browse files
committed
Fixing that multiple-select dropdown wouldn't stay open, fixes #139 #143
1 parent f6386e8 commit 81205fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/angular-materialize.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(function (angular) {
2+
var undefined;
23
angular.module("ui.materialize", ["ui.materialize.ngModel", "ui.materialize.collapsible", "ui.materialize.toast", "ui.materialize.sidenav", "ui.materialize.material_select", "ui.materialize.dropdown", "ui.materialize.inputfield", "ui.materialize.input_date", "ui.materialize.tabs", "ui.materialize.pagination", "ui.materialize.pushpin", "ui.materialize.scrollspy", "ui.materialize.parallax","ui.materialize.modal", "ui.materialize.tooltipped", "ui.materialize.slider", "ui.materialize.materialboxed", "ui.materialize.scrollFire", "ui.materialize.nouislider"]);
34

45
/* example usage:
@@ -278,6 +279,12 @@
278279
return;
279280
}
280281
}
282+
if (newVal !== undefined && element.siblings("ul.active").length) { // If select is open
283+
var selectedOptions = element.siblings("ul.active").children("li.active").length; // Number of selected elements
284+
if (selectedOptions == newVal.length) {
285+
return;
286+
}
287+
}
281288
}
282289
element.siblings(".caret").remove();
283290
scope.$evalAsync(function() {

0 commit comments

Comments
 (0)