Skip to content

Commit

Permalink
Fix corner case onChange when key is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
peacechen committed Jul 7, 2021
1 parent 8f32e08 commit fc1c016
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class ModalSelector extends React.Component {
}

onChange = (item) => {
if (!item || !item.key) {
if (!item || item.key == null) { // == coercion
return;
}
this.props.onChange(item);
Expand Down

0 comments on commit fc1c016

Please sign in to comment.