Skip to content

Commit

Permalink
fix picker multicolumn with same key bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisHchen committed Aug 30, 2017
1 parent 3bae2ec commit 5dd9372
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/Picker/Picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ class Picker extends Component {
}
}

let treeChildren2 = this.props.dataSource.reduce((a, b) => {
return a.concat(b);
}, []);
treeChildren2 = treeChildren2.filter((item) => { return ~value.indexOf(item[valueMember]); });

const treeChildren2 = data.map((d, index) => {
if (value[index]) {
return d.find(obj => value[index] === obj[valueMember]);
}
return undefined;
}).filter(t => !!t);
return this._displayRender(treeChildren2);
};

Expand Down

0 comments on commit 5dd9372

Please sign in to comment.