Skip to content

Commit

Permalink
Add value attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
rkit committed Dec 2, 2015
1 parent 20f8a6c commit d612131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-select2-wrapper",
"version": "0.0.7",
"version": "0.0.8",
"description": "React component for Select2",
"main": "lib/components/Select2.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Select2 extends Component {
{this.props.data.map((item, k) => {
if (typeof item === 'string' ||
((!!item && typeof item === 'object') && Object.prototype.toString.call(item) === '[object String]')) {
return (<option key={'option-' + k}>{item}</option>);
return (<option key={'option-' + k} value={item}>{item}</option>);
}
return (<option key={'option-' + k} value={item.id}>{item.text}</option>);
})}
Expand Down

0 comments on commit d612131

Please sign in to comment.