Fix array check on autocomplete

old
Miguel Ping 2015-11-24 12:59:19 +00:00
parent 1c822d2234
commit 726a7772ee
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ class Autocomplete extends React.Component {
source () {
const { source } = this.props;
if (source.hasOwnProperty(length)) {
if (source.hasOwnProperty('length')) {
return new Map(source.map((item) => [item, item]));
} else {
return new Map(Object.keys(source).map((key) => [key, source[key]]));