From b0f17625fd562ec51fe539cd5ada392baf7d0e02 Mon Sep 17 00:00:00 2001 From: Adrian Hangan Date: Tue, 28 Feb 2017 15:11:51 +0200 Subject: [PATCH 1/2] fix for: selected=null and multi=true didn't clear selected options --- demo/demo-custom-objects-as-options.html | 8 ++++---- etools-searchable-multiselection-menu.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demo/demo-custom-objects-as-options.html b/demo/demo-custom-objects-as-options.html index c89f5cd..a72abad 100644 --- a/demo/demo-custom-objects-as-options.html +++ b/demo/demo-custom-objects-as-options.html @@ -93,13 +93,13 @@

Custom objects as options and selected property with no change events

this.set('customObjOptions', this.generateOptions()); }.bind(this), 3000); - // setTimeout(function() { - // this.set('selectedId', 3); - // }.bind(this), 3000); + setTimeout(function() { + this.set('selectedIds', null); + }.bind(this), 7000); }, _returnIdsString: function(vals) { - return vals.join(', '); + return vals instanceof Array ? vals.join(', ') : null; }, _singleSelectionChanged: function(event) { diff --git a/etools-searchable-multiselection-menu.html b/etools-searchable-multiselection-menu.html index 7187ea6..ca8438a 100644 --- a/etools-searchable-multiselection-menu.html +++ b/etools-searchable-multiselection-menu.html @@ -549,7 +549,7 @@ } }, _valueChanged: function(value) { - if (!value) { + if (!value || (value instanceof Array && value.length === 0)) { // empty value/reset selection this.set('selectedValues', null); return; From bee554bb89dd7ac54d495babb589c5a089c491f9 Mon Sep 17 00:00:00 2001 From: Adrian Hangan Date: Tue, 28 Feb 2017 15:13:37 +0200 Subject: [PATCH 2/2] bower.jsonversion update --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 05e0d74..b51ed8c 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "etools-searchable-multiselection-menu", "description": "Dropdown menu with search and multiple options selection", - "version": "1.0.27", + "version": "1.0.28", "license": "https://github.com/unicef-polymer/etools-searchable-multiselection-menu/blob/master/LICENSE.md", "main": "etools-searchable-multiselection-menu.html", "dependencies": {