From 81205fc10e07e693852cafdcaf8390878dd0b47b Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Wed, 20 Apr 2016 12:24:59 +0200 Subject: [PATCH] Fixing that multiple-select dropdown wouldn't stay open, fixes #139 #143 --- src/angular-materialize.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/angular-materialize.js b/src/angular-materialize.js index 97db1b9..a42d0fe 100644 --- a/src/angular-materialize.js +++ b/src/angular-materialize.js @@ -1,4 +1,5 @@ (function (angular) { + var undefined; 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"]); /* example usage: @@ -278,6 +279,12 @@ return; } } + if (newVal !== undefined && element.siblings("ul.active").length) { // If select is open + var selectedOptions = element.siblings("ul.active").children("li.active").length; // Number of selected elements + if (selectedOptions == newVal.length) { + return; + } + } } element.siblings(".caret").remove(); scope.$evalAsync(function() {