diff --git a/README.md b/README.md index bfad15f..6c4941e 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,9 @@ ReactDOM.render(, container); tipFormatter - function + function or `null` - Format the value of the tooltip if it shows. + Format the value of the tooltip if it shows. If `null` the tooltip will always be hidden. dots diff --git a/examples/slider.js b/examples/slider.js index 9eb2ea5..ce5d6f0 100644 --- a/examples/slider.js +++ b/examples/slider.js @@ -86,6 +86,10 @@ ReactDOM.render(

Basic Slider with `tipFormatter`

+
+

Basic Slider without tooltip

+ +

Controlled Slider

diff --git a/src/Slider.jsx b/src/Slider.jsx index b5ff2ef..91b990d 100644 --- a/src/Slider.jsx +++ b/src/Slider.jsx @@ -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 = (