From 7702bb67968104a64fa85ba7e893bf2393eeb3c5 Mon Sep 17 00:00:00 2001 From: MG12 Date: Fri, 20 Nov 2015 14:57:36 +0800 Subject: change value to null when clear input content to remove the react warning. --- HISTORY.md | 5 +++++ examples/pick-time.js | 4 ++-- package.json | 2 +- src/TimePicker.jsx | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index e4b12b6..ed2c9b2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,11 @@ --- +0.7.1 / 2015-11-20 +------------------ + +`fix` change value to null when clear input content to remove the react warning. + 0.7.0 / 2015-11-20 ------------------ diff --git a/examples/pick-time.js b/examples/pick-time.js index d5e3715..70de23d 100644 --- a/examples/pick-time.js +++ b/examples/pick-time.js @@ -15,8 +15,8 @@ const formatter = new DateTimeFormat('HH:mm:ss'); const now = new GregorianCalendar(zhCn); now.setTime(Date.now()); -function onChange(v) { - console.log(v && formatter.format(v)); +function onChange(value) { + console.log(value && formatter.format(value)); } ReactDom.render( diff --git a/package.json b/package.json index e721be7..569661f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-time-picker", - "version": "0.7.0", + "version": "0.7.1", "description": "React TimePicker", "keywords": [ "react", diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 060446a..e82b46f 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -75,7 +75,7 @@ const Picker = React.createClass({ }, onPanelClear() { - this.setValue(''); + this.setValue(null); this.setOpen(false); }, -- cgit v1.2.3