Merge pull request #307 from epilgrim/feature/allow_array_of_key_value_in_autocomplete

Allowing array of pairs key-value as input for autocomplete
old
Javi Velasco 2016-02-10 09:52:42 +01:00
commit 8d2e8ca338
1 changed files with 1 additions and 1 deletions

View File

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