From 186a1b3f4c38b5327052ba1bbe85d2eaf19704b0 Mon Sep 17 00:00:00 2001 From: Aadit Kamat Date: Sat, 19 Sep 2020 23:27:09 +0800 Subject: [PATCH] Fix backspace crash --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5317efb..68430c0 100644 --- a/src/index.js +++ b/src/index.js @@ -187,7 +187,7 @@ class App extends React.Component { const r = parseInt(e.target.value, 10); // Text inputs can sometimes temporarily be in invalid states. // If it's not a valid number, refuse to set it. - if (typeof r !== "undefined") { + if (!isNaN(r)) { this.setState({[state_key]: r}); } };