Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #40 from snrbrnjna/fix-for-first-option-not-select…
Browse files Browse the repository at this point in the history
…able

do not filter out zero values in getSelectedProperties
  • Loading branch information
Mobius1 committed Oct 2, 2017
2 parents fee8d35 + f2ca67f commit 849c66a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/selectr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,9 @@

Selectr.prototype.getSelectedProperties = function (prop) {
var selected = this.getSelected();
var values = [].slice.call(selected).map(function(option) { return option[prop]; }).filter(function(i) { return !!i; });
var values = [].slice.call(selected)
.map(function(option) { return option[prop]; })
.filter(function(i) { return i!==null && i!==undefined; });
return values;
};

Expand Down

0 comments on commit 849c66a

Please sign in to comment.