Compare commits

...
1 Commits
Author SHA1 Message Date
yiminghe 2cb0dbce6f fix: work with rc-form 2016-01-30 18:52:12 +08:00
2 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "rc-slider", "name": "rc-slider",
"version": "3.3.1", "version": "3.3.2",
"description": "slider ui component for react", "description": "slider ui component for react",
"keywords": [ "keywords": [
"react", "react",
+2 -2
View File
@@ -34,7 +34,7 @@ class Slider extends React.Component {
const {range, min, max} = props; const {range, min, max} = props;
const initialValue = range ? [min, min] : min; const initialValue = range ? [min, min] : min;
const defaultValue = ('defaultValue' in props ? props.defaultValue : initialValue); const defaultValue = ('defaultValue' in props ? props.defaultValue : initialValue);
const value = ('value' in props ? props.value : defaultValue); const value = (props.value !== undefined ? props.value : defaultValue);
let upperBound; let upperBound;
let lowerBound; let lowerBound;
@@ -85,7 +85,7 @@ class Slider extends React.Component {
this.props.onChange([nextLowerBound, nextUpperBound]); this.props.onChange([nextLowerBound, nextUpperBound]);
} }
} else { } else {
const value = 'value' in nextProps ? nextProps.value : upperBound; const value = nextProps.value !== undefined ? nextProps.value : upperBound;
const nextValue = this.trimAlignValue(value, nextProps); const nextValue = this.trimAlignValue(value, nextProps);
if (nextValue === upperBound && lowerBound === nextProps.min) return; if (nextValue === upperBound && lowerBound === nextProps.min) return;