From 8dad311df0f17acbfa88ae48e5dce4fc8fc64fd2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 2 Aug 2018 16:24:13 +0800 Subject: [PATCH] Fix Slider demo error when input non-number string, close #11553 --- components/slider/demo/input-number.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/slider/demo/input-number.md b/components/slider/demo/input-number.md index 1f06e0a51d..4745827361 100644 --- a/components/slider/demo/input-number.md +++ b/components/slider/demo/input-number.md @@ -22,6 +22,9 @@ class IntegerStep extends React.Component { } onChange = (value) => { + if (isNaN(value)) { + return; + } this.setState({ inputValue: value, }); @@ -54,6 +57,9 @@ class DecimalStep extends React.Component { } onChange = (value) => { + if (isNaN(value)) { + return; + } this.setState({ inputValue: value, });