From 0624d16477db634955235b01c76dfcc632c123be Mon Sep 17 00:00:00 2001 From: Adrian Hangan Date: Fri, 3 Mar 2017 16:00:36 +0200 Subject: [PATCH] bug fix --- demo/demo-custom-objects-as-options.html | 4 ++-- demo/index.html | 8 ++++---- etools-searchable-multiselection-menu.html | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/demo/demo-custom-objects-as-options.html b/demo/demo-custom-objects-as-options.html index 5caba65..60cebde 100644 --- a/demo/demo-custom-objects-as-options.html +++ b/demo/demo-custom-objects-as-options.html @@ -26,7 +26,7 @@

Multiple selection, custom objects as options

Custom objects as options and selected property with no change events

- + update-selected dynamic-align empty-value style="width: 350px;">

SelectedIDs: [[_returnIdsString(selectedIds)]]

etools-searchable-multiselection-menu demo

- +

Custom objects as options. You can specify value and label properties from object option to be used.

@@ -141,13 +141,13 @@

Custom objects as options. You can specify value and label properties from o - + diff --git a/etools-searchable-multiselection-menu.html b/etools-searchable-multiselection-menu.html index 1909749..d0b369b 100644 --- a/etools-searchable-multiselection-menu.html +++ b/etools-searchable-multiselection-menu.html @@ -744,11 +744,11 @@ } var selectedVals = null; - if (this.multi && Array.isArray(selectedValues)) { + if (this.multi) { // multiselection // selected will be empty array if selectedValues.length === 0 selectedVals = []; - if (selectedValues.length > 0) { + if (Array.isArray(selectedValues) && selectedValues.length > 0) { selectedVals = selectedValues.map(function(s) { return this._prepareValue(s); }.bind(this));