sukima / ember-cli-select-picker

An enhanced Boostrap styled select component addon for Ember CLI
https://sukima.github.io/ember-cli-select-picker
MIT License
23 stars 15 forks source link

Ember.get no longer allows empty string to return the whole object #64

Closed technomage closed 7 years ago

technomage commented 7 years ago

A recent change in Ember.get no longer allows am empty string to return the whole object. This impacts the use of labelPath and valuePath for options.

Making the same changes to these as for groupPath resolves the issue:

  var selection = this.selectionAsArray().map(function(item) {
    return valuePath ? Ember.get(item, valuePath) : item;
  });
  var searchMatcher = this.makeSearchMatcher();

  var result = _compact(Ember.makeArray(this.get('content'))
    .map(function(item, index) {
      const label = labelPath ? Ember.get(item, labelPath) : item;
      const value = valuePath ? Ember.get(item, valuePath) : item;