Giter Site home page Giter Site logo

Comments (6)

Edulopez avatar Edulopez commented on May 31, 2024 1

I think the solution should not close the issue. It looks like a workaround that "fixes" a problem with eventOff="blur scroll"

from react-tooltip.

aronhelser avatar aronhelser commented on May 31, 2024 1

The tooltip can be configured to hide or not on scroll. Take a look at the example page for Scrolling.

from react-tooltip.

linonetwo avatar linonetwo commented on May 31, 2024 1

To use with react-windowed-list

import WindowedList from 'react-windowed-list';
import ReactTooltip from 'react-tooltip';
import { useThrottledFn } from 'beautiful-react-hooks';

  const tooltipRefresh = useThrottledFn(
    () => {
      ReactTooltip.hide();
      ReactTooltip.rebuild();
    },
    500,
    null,
    [],
  );
  const renderItem = useCallback(index => {
    tooltipRefresh();
    return <>
...

<ReactTooltip />
<WindowedList

from react-tooltip.

scerelli avatar scerelli commented on May 31, 2024

It's pretty easy to handle this bug but i think is not a good behaviour.

anyway this solves the problem:

componentDidMount: function() {
    window.addEventListener("scroll", this.hideTooltip);
  },

  componentWillUnmount: function() {
    window.removeEventListener("scroll", this.hideTooltip);
  },

  hideTooltip: function() {
    ReactTooltip.hide();
  }

from react-tooltip.

wwayne avatar wwayne commented on May 31, 2024

@scerelli
Thanks, just added scroll event listener when tooltip show and remove the listener after tooltip hide.
Sometimes the hide action is triggered late, I think it may have something to do with the mechanism of the browser's scroll(or maybe just because my computer is slow...), anyway, I think it's ok

from react-tooltip.

jhlee-swk avatar jhlee-swk commented on May 31, 2024

I had a problem similar to this, but after further debugging, project that I was working had no window scroll, only element scroll. so none of the solutions above worked.
I managed to fix? it by adding 'onScroll' event on the element that was scrolling
example:

 public hideUpdateTooltip = () => {
      Tooltip.hide()
 }

 <div onScroll={this.hideUpdateTooltip}>
    //some codes...
 </div>

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.