diff options
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/module/Select.jsx | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/package.json b/package.json index 61aabc7..358a38f 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": "1.0.0-alpha9", | 3 | "version": "1.0.0", |
4 | "description": "React TimePicker", | 4 | "description": "React TimePicker", |
5 | "keywords": [ | 5 | "keywords": [ |
6 | "react", | 6 | "react", |
diff --git a/src/module/Select.jsx b/src/module/Select.jsx index ab10789..2ab9e61 100644 --- a/src/module/Select.jsx +++ b/src/module/Select.jsx | |||
@@ -38,9 +38,11 @@ const Select = React.createClass({ | |||
38 | this.scrollToSelected(0); | 38 | this.scrollToSelected(0); |
39 | }, | 39 | }, |
40 | 40 | ||
41 | componentDidUpdate() { | 41 | componentDidUpdate(prevProps) { |
42 | // smooth scroll to selected option | 42 | // smooth scroll to selected option |
43 | this.scrollToSelected(120); | 43 | if (prevProps.selectedIndex !== this.props.selectedIndex) { |
44 | this.scrollToSelected(120); | ||
45 | } | ||
44 | }, | 46 | }, |
45 | 47 | ||
46 | onSelect(value) { | 48 | onSelect(value) { |