mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
Merge pull request #61 from frank-weindel/hide-the-tip
If tipFormatter is null, don't show the tip
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user