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

Commit

Permalink
Merge pull request #890 from metasfresh/dev-877
Browse files Browse the repository at this point in the history
n instead of none in dropdowns #877
  • Loading branch information
damianprzygodzki committed Jun 14, 2017
2 parents 09e0401 + 3b13703 commit ea141cc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/widget/List/RawList.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ class RawList extends Component {
}

const optionKeys = Object.keys(option);
const selectedKeys = Object.keys(selected);
const selectedKeys = selected && Object.keys(selected);
const firstOption = option[optionKeys[0]];
const firstSelected = selected[selectedKeys[0]];
const firstSelected = selected && selected[selectedKeys[0]];

// objects, and first elements are not
if (
Expand Down Expand Up @@ -389,8 +389,14 @@ class RawList extends Component {
isOpen
} = this.state;

const value = defaultValue &&
let value = '';

if(typeof defaultValue === 'string') {
value = defaultValue;
} else {
value = defaultValue &&
defaultValue[Object.keys(defaultValue)[0]];
}

return (
<div
Expand Down

0 comments on commit ea141cc

Please sign in to comment.