React-tooltip: Add animations for tooltip

Created on 27 Jun 2017  路  7Comments  路  Source: wwayne/react-tooltip

Good day! I want to add animations for show tooltip (fadeIn, fadeOut), i sending a className prop and this class add animation for opacity, but it's not work! How can I add animations?

Most helpful comment

Yes, I also found the ability to add className quite useless if not adding !important all over the place.
Also, it'd be really nice to be able to add animations.

All 7 comments

Yes, I also found the ability to add className quite useless if not adding !important all over the place.
Also, it'd be really nice to be able to add animations.

@FoxWhite it's will be nice.

Any updates on this one if it's possible to modify the animation?

Is this possible in a newer version? The fade out animation is rather abrupt right now.

.__react_component_tooltip {
transition: all 0.3s ease-in-out !important;
opacity: 0 !important;
visibility: visible;
}

.__react_component_tooltip.show {
visibility: visible;
opacity: 1 !important;
}

Had some weirdness with the above snippet (the tooltip teleports on the first hover, slides in horizontally on the second, and then works fine); all that seems to be necessary is:

.__react_component_tooltip {
    transition: opacity 0.3s ease-in-out !important;
    visibility: visible;
}

The fix above posted by @zackypick worked for me, but transitioning all properties did give a similar bug as described by @karashiiro. I am doing some custom positioning so that's probably come into play. The fix for me was to animate opacity and visibility instead of all.

.__react_component_tooltip {
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-out !important;
  opacity: 0 !important;
  visibility: visible;
}

.__react_component_tooltip.show {
  visibility: visible;
  opacity: 1 !important;
}
Was this page helpful?
0 / 5 - 0 ratings