Slider: How to set visible=true when I use createSliderWithTooltip option

Created on 26 Mar 2018  路  2Comments  路  Source: react-component/slider

I need to use tipFormatter to show value in % so I use createSliderWithTooltip extention. But I don't know how to manage visibiltiy of tip.
In such case I can only transfer the tipProps={聽placement: 'top',聽prefixCls: 'rc-slider-tooltip',聽overlay: tipFormatter(value)聽} and can't set visibility...
Thanks in advance for any help!

Most helpful comment

Perhaps a little late, but an unrelated search led me to this.
Here is my solution.

import { Range, createSliderWithTooltip } from 'rc-slider'
const Ranger = createSliderWithTooltip(Range);

class CompSlider .....
....
....
     <Ranger 
      tipProps={
        {
          visible: true
        }
      }
      ...other props...
      />
....

All 2 comments

@matveychuk
I think there is no solution with tooltip. But you can use following method, it works for me.

<Slider step={10} defaultValue={50} min={10} max={120} handle={(props) => { // Custom Tooltip return ( <span className={props.className} style={{ left: props.value+'%' }}> {props.value} </span> ) }} />

Perhaps a little late, but an unrelated search led me to this.
Here is my solution.

import { Range, createSliderWithTooltip } from 'rc-slider'
const Ranger = createSliderWithTooltip(Range);

class CompSlider .....
....
....
     <Ranger 
      tipProps={
        {
          visible: true
        }
      }
      ...other props...
      />
....
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nitroamos picture nitroamos  路  4Comments

Bernabe-Felix picture Bernabe-Felix  路  3Comments

ka7eh picture ka7eh  路  6Comments

johnb8005 picture johnb8005  路  6Comments

gpinhey picture gpinhey  路  6Comments