diff options
author | MG12 <wuzhao.mail@gmail.com> | 2015-11-20 14:57:36 +0800 |
---|---|---|
committer | MG12 <wuzhao.mail@gmail.com> | 2015-11-20 14:57:36 +0800 |
commit | 7702bb67968104a64fa85ba7e893bf2393eeb3c5 (patch) | |
tree | 6e29e2f103e9a25be9f6db046d0e0be87565b5e6 | |
parent | 1d08ffb2f913e1cc9d39fd56cf9d0522d3bf29bf (diff) | |
download | time-picker-7702bb67968104a64fa85ba7e893bf2393eeb3c5.tar.gz time-picker-7702bb67968104a64fa85ba7e893bf2393eeb3c5.tar.zst time-picker-7702bb67968104a64fa85ba7e893bf2393eeb3c5.zip |
change value to null when clear input content to remove the react warning.
-rw-r--r-- | HISTORY.md | 5 | ||||
-rw-r--r-- | examples/pick-time.js | 4 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/TimePicker.jsx | 2 |
4 files changed, 9 insertions, 4 deletions
@@ -2,6 +2,11 @@ | |||
2 | 2 | ||
3 | --- | 3 | --- |
4 | 4 | ||
5 | 0.7.1 / 2015-11-20 | ||
6 | ------------------ | ||
7 | |||
8 | `fix` change value to null when clear input content to remove the react warning. | ||
9 | |||
5 | 0.7.0 / 2015-11-20 | 10 | 0.7.0 / 2015-11-20 |
6 | ------------------ | 11 | ------------------ |
7 | 12 | ||
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'); | |||
15 | const now = new GregorianCalendar(zhCn); | 15 | const now = new GregorianCalendar(zhCn); |
16 | now.setTime(Date.now()); | 16 | now.setTime(Date.now()); |
17 | 17 | ||
18 | function onChange(v) { | 18 | function onChange(value) { |
19 | console.log(v && formatter.format(v)); | 19 | console.log(value && formatter.format(value)); |
20 | } | 20 | } |
21 | 21 | ||
22 | ReactDom.render( | 22 | ReactDom.render( |
diff --git a/package.json b/package.json index e721be7..569661f 100644 --- a/package.json +++ b/package.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "name": "rc-time-picker", | 2 | "name": "rc-time-picker", |
3 | "version": "0.7.0", | 3 | "version": "0.7.1", |
4 | "description": "React TimePicker", | 4 | "description": "React TimePicker", |
5 | "keywords": [ | 5 | "keywords": [ |
6 | "react", | 6 | "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({ | |||
75 | }, | 75 | }, |
76 | 76 | ||
77 | onPanelClear() { | 77 | onPanelClear() { |
78 | this.setValue(''); | 78 | this.setValue(null); |
79 | this.setOpen(false); | 79 | this.setOpen(false); |
80 | }, | 80 | }, |
81 | 81 | ||