From 173b8c46ad40a310a9d9ba2510c769dffdec855b Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 19 Feb 2017 15:21:46 +0800 Subject: [PATCH] Fix input demo tooltip --- .../__tests__/__snapshots__/demo.test.js.snap | 18 +++++++----------- components/input/demo/tooltip.md | 9 +++------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 539f20ecdc..27a22a770f 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -405,15 +405,11 @@ exports[`test renders ./components/input/demo/textarea.md correctly 1`] = ` `; exports[`test renders ./components/input/demo/tooltip.md correctly 1`] = ` -
-
- -
-
+ `; diff --git a/components/input/demo/tooltip.md b/components/input/demo/tooltip.md index f3c9318412..93217e8648 100644 --- a/components/input/demo/tooltip.md +++ b/components/input/demo/tooltip.md @@ -40,7 +40,6 @@ class NumericInput extends React.Component { this.props.onChange(value); } } - // '.' at the end or only '-' in the input box. onBlur = () => { const { value, onBlur, onChange } = this.props; @@ -51,14 +50,13 @@ class NumericInput extends React.Component { onBlur(); } } - render() { const { value } = this.props; const title = value ? ( {value !== '-' ? formatNumber(value) : '-'} - ) : ''; + ) : 'Input a number'; return ( @@ -87,8 +85,7 @@ class NumericInputDemo extends React.Component { this.setState({ value }); } render() { - const { value } = this.state; - return ; + return ; } }