Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Hangan committed Mar 3, 2017
1 parent 86cb518 commit 0624d16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions demo/demo-custom-objects-as-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ <h3>Multiple selection, custom objects as options</h3>

<h3>Custom objects as options and selected property with no change events</h3>

<!--<p><span>SelectedID:</span> [[selectedId]]</p>
<p><span>SelectedID:</span> [[selectedId]]</p>
<etools-searchable-multiselection-menu
label="Searchable menu, custom objects"
options="[[customObjOptions]]"
custom-object-options
option-value="id"
option-label="option_label"
selected="{{selectedId}}"
update-selected dynamic-align empty-value style="width: 350px;"></etools-searchable-multiselection-menu>-->
update-selected dynamic-align empty-value style="width: 350px;"></etools-searchable-multiselection-menu>

<p><span>SelectedIDs:</span> [[_returnIdsString(selectedIds)]]</p>
<etools-searchable-multiselection-menu
Expand Down
8 changes: 4 additions & 4 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="vertical-section-container centered">
<h1>etools-searchable-multiselection-menu demo</h1>

<!--<h2>Single selection, with search</h2>
<h2>Single selection, with search</h2>
<demo-snippet>
<template is="dom-bind">
<demo-helper selected-values="{{selectedValues}}" real-options="{{realOptions}}"></demo-helper>
Expand Down Expand Up @@ -130,7 +130,7 @@ <h2>Error messages and validations</h2>
<template>
<demo-error-messages-and-validations></demo-error-messages-and-validations>
</template>
</demo-snippet>-->
</demo-snippet>


<h2>Custom objects as options. You can specify value and label properties from object option to be used.</h2>
Expand All @@ -141,13 +141,13 @@ <h2>Custom objects as options. You can specify value and label properties from o
</template>
</demo-snippet>

<!--<h2>Readonly state</h2>
<h2>Readonly state</h2>

<demo-snippet>
<template>
<demo-readonly-state></demo-readonly-state>
</template>
</demo-snippet>-->
</demo-snippet>

</div>

Expand Down
4 changes: 2 additions & 2 deletions etools-searchable-multiselection-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0624d16

Please sign in to comment.