Skip to content

Commit 180a4db

Browse files
committed
Merge pull request #11 from Lajnold/master
Pass through option parameters
2 parents 22a60de + d4c7b41 commit 180a4db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Select2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export default class Select2 extends Component {
6262
((!!item && typeof item === 'object') && Object.prototype.toString.call(item) === '[object String]')) {
6363
return (<option key={'option-' + k} value={item}>{item}</option>);
6464
}
65-
return (<option key={'option-' + k} value={item.id}>{item.text}</option>);
65+
66+
const { id, text, ...itemParams } = item;
67+
return (<option key={'option-' + k} value={id} {...itemParams}>{text}</option>);
6668
})}
6769
</select>
6870
);

0 commit comments

Comments
 (0)