From fc1c016f685e40472683d98b79b7c067b92b44e6 Mon Sep 17 00:00:00 2001 From: peacechen Date: Wed, 7 Jul 2021 08:59:26 -0500 Subject: [PATCH] Fix corner case onChange when key is 0 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d8a803c..e8224b7 100644 --- a/index.js +++ b/index.js @@ -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);