Merge pull request #61 from frank-weindel/hide-the-tip

If tipFormatter is null, don't show the tip
This commit is contained in:
Benjy Cui
2015-12-18 09:18:41 +08:00
3 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -144,9 +144,9 @@ ReactDOM.render(<Rcslider />, container);
</tr>
<tr>
<td>tipFormatter</td>
<td>function</td>
<td>function or `null`</td>
<td></td>
<td>Format the value of the tooltip if it shows.</td>
<td>Format the value of the tooltip if it shows. If `null` the tooltip will always be hidden.</td>
</tr>
<tr>
<td>dots</td>
+4
View File
@@ -86,6 +86,10 @@ ReactDOM.render(
<p>Basic Slider with `tipFormatter`</p>
<Slider tipFormatter={percentFormatter} tipTransitionName="rc-slider-tooltip-zoom-down" onChange={log} />
</div>
<div style={style}>
<p>Basic Slider without tooltip</p>
<Slider tipFormatter={null} onChange={log} />
</div>
<div style={style}>
<p>Controlled Slider</p>
<Slider value={50} />
+1 -1
View File
@@ -339,7 +339,7 @@ class Slider extends React.Component {
const lowerOffset = this.calcOffset(lowerBound);
const handleClassName = prefixCls + '-handle';
const isNoTip = (step === null) && !tipFormatter;
const isNoTip = (step === null) || (tipFormatter === null);
const upper = (<Handle className={handleClassName}
noTip={isNoTip} tipTransitionName={tipTransitionName} tipFormatter={tipFormatter}