Skip to content

Commit 825d94d

Browse files
committed
onChange should fire only for valid option with key (#140)
1 parent 34245a1 commit 825d94d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ export default class ModalSelector extends React.Component {
175175
}
176176

177177
onChange = (item) => {
178+
if (!item || !item.key) {
179+
return;
180+
}
178181
this.props.onChange(item);
179182
this.setState({ selected: this.props.labelExtractor(item), changedItem: item }, () => {
180183
if (this.props.closeOnChange)

0 commit comments

Comments
 (0)