Giter Site home page Giter Site logo

Comments (10)

wwayne avatar wwayne commented on May 20, 2024

allow JSX objects for tooltip content

This feature has been supported
Example: http://wwayne.github.io/react-tooltip/
HISTORY.MD: https://github.com/wwayne/react-tooltip/blob/master/HISTORY.md

from react-tooltip.

artaommahe avatar artaommahe commented on May 20, 2024

Thx :)

from react-tooltip.

artaommahe avatar artaommahe commented on May 20, 2024

What about tooltip visibility on hover for solid state?

from react-tooltip.

wwayne avatar wwayne commented on May 20, 2024

@artaommahe
Sorry I didn't get you, can you explain more details to me?

or you mean this? prevent tooltip hide on tooltip hover

from react-tooltip.

artaommahe avatar artaommahe commented on May 20, 2024

Yep. It's very usefull for placing links in tooltip, e.x.

Some description ... read more

now i can't do this cause tooltips hides on parent element hover lost, and it's forced me to use another tooltip lib just for this case

from react-tooltip.

wwayne avatar wwayne commented on May 20, 2024

@artaommahe
Done, you can combine using the feature class and delayHide of react-tooltip to achieve this:

<a data-tip="tooltip" data-class="extra" data-delay-hide="500"></a>
<ReactTooltip />

.extra {
 &:hover {
   visibility: visible !important;
   opacity: 1 !important;
 }
}

from react-tooltip.

artaommahe avatar artaommahe commented on May 20, 2024

Thanks, now i can rid of second tooltip lib :)

from react-tooltip.

tnrich avatar tnrich commented on May 20, 2024

Hey there @wwayne , I'm having trouble getting this to work, but I'm not quite sure why..It doesn't seem as if the hover state is being activated when I hover over the tooltip element. If I manually activate the hover state in the chrome console, the tooltip will remain popped up.

Here's some code snippets of what I'm trying to do:

.extra {
    &:hover {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

.__react_component_tooltip {
    top: 0px !important;
    left: 0px !important;



    background: none !important;
    color: black !important;
    &:after{
        border-top: none !important;
    }
    span {
        background: white;
    }
}
<foreignObject x={x3} y={y3}>
          <div className='labelTooltip' style={{position: 'relative'}}>
            <ReactTooltip effect='solid' delayHide={100} offset={{top: 0, left: 0}} id={'tooltip' + key}>
              <div>
                {labels.map(function(label){
                  return <div>
                    <span>
                      {label.text}
                    </span>
                  </div>
                })}
              </div>
            </ReactTooltip>
          </div>
        </foreignObject>


<text
        data-tip
        data-class="extra"
        // data-delay-hide="500"
        data-for={'tooltip' + key}
        key={'text' + key}
        className='dragMe clickable'
        x={x3}
        y={y3}
        style={ {textAnchor: x3 > 0 ? "start" : "end", fontSize: '12px'} }>
        {text + (multipleLabels ? '...' : '')}
      </text>

Thanks for the help!

Thomas

from react-tooltip.

wwayne avatar wwayne commented on May 20, 2024

@tnrich I haven't seen anything wrong with JS part, but I wonder why you change the css of the class __react_component_tooltip? I doubt top: 0px !important; left: 0px !important; makes the tooltip become abnormal.
PS: you can omit offset={{top: 0, left: 0}}

Feel free to ask me if you still have problem.

from react-tooltip.

mklimkin0190 avatar mklimkin0190 commented on May 20, 2024

In case anybody has the same problem as @tnrich did, with hover not triggering, add pointer-events: auto !important; to the .extra css class. Found here: #227

from react-tooltip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.