Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

Commit

Permalink
Fixed a bug in the select component that was causing blank strings to…
Browse files Browse the repository at this point in the history
… show for selected Item (label).
  • Loading branch information
Aman Patel committed May 16, 2016
1 parent a448f42 commit 9f6fcf6
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,26 @@ import coerceBoolean from './utils/coerceBoolean.js'
selectedItems() {
let foundItems = []
if (this.value.length) {
this.value.forEach(item => {
if (typeof item === "string") {
let option
this.options.some(o => {
if(o.value === item) {
option = o
return true
}
})
option && foundItems.push(option.label)
}
})
for (var item of this.value) {
if (this.options.length ===0)
{
//
foundItems = this.value;
}
else
{
if (typeof item === "string") {
let option
this.options.some(o => {
if(o.value === item) {
option = o
return true
}
})
option && foundItems.push(option.label)
}
}
}
return foundItems.join(', ')
}
},
Expand Down

0 comments on commit 9f6fcf6

Please sign in to comment.