fix: Slider 点击圆点后气泡提示会消失以及分段式滑块无法拖动问题。

This commit is contained in:
simaQ
2015-08-19 16:51:28 +08:00
parent 38edc4db93
commit 41f5ddb9bd
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -9,6 +9,6 @@ function onChange(v){
console.log(v);
}
// React.render(<Slider marks={["一","二","三","四","五"]} index={3}/>, document.getElementById('__react-content'));
// React.render(<Slider className='rc-slider' step={20}/>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider marks={["一","二","三","四","五"]} defaultIndex={2} /></div>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange}/></div>, document.getElementById('__react-content'));
+2 -1
View File
@@ -33,7 +33,7 @@ function getValueFromIndex(props) {
}
if (marksLen > 0) {
value = ((props.max - props.min) / (marksLen - 1)) * (index);
value = value.toFixed(5);
value = value.toFixed(5) / 1;
}
return value;
}
@@ -299,6 +299,7 @@ const Slider = React.createClass({
tooltipVisible = true;
} else {
events = {
onClick: this.showTooltip.bind(this, true),
onMouseEnter: this.showTooltip.bind(this, true),
onMouseLeave: this.showTooltip.bind(this, false),
};