From 39de81dfa9ddea444029168233360a61f2a95c30 Mon Sep 17 00:00:00 2001 From: Frank Weindel Date: Wed, 16 Dec 2015 16:38:15 -0500 Subject: [PATCH 1/4] If tipFormatter is null, don't show the tip --- src/Slider.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Slider.jsx b/src/Slider.jsx index b5ff2ef..141fe43 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 = tipFormatter === null || (step === null && !tipFormatter); const upper = ( Date: Wed, 16 Dec 2015 16:42:13 -0500 Subject: [PATCH 2/4] Add documentation on how to hide the tip --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 24f3b755b2e555f0e30e8c3e99cebac55fdaa514 Mon Sep 17 00:00:00 2001 From: Frank Weindel Date: Thu, 17 Dec 2015 10:48:54 -0500 Subject: [PATCH 3/4] Add example for hiding the tooltip --- examples/slider.js | 4 ++++ 1 file changed, 4 insertions(+) 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

From 4c57f3ecca4c039307dea860a110397d35454232 Mon Sep 17 00:00:00 2001 From: Frank Weindel Date: Thu, 17 Dec 2015 10:49:29 -0500 Subject: [PATCH 4/4] Refactor isNoTip expression --- src/Slider.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Slider.jsx b/src/Slider.jsx index 141fe43..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 = tipFormatter === null || (step === null && !tipFormatter); + const isNoTip = (step === null) || (tipFormatter === null); const upper = (