react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

scrollHide not hiding tooltip on mobile

Open ryan-hamblin opened this issue 9 years ago • 22 comments

I'm assuming this has something to do with the "hover" event since there isn't really one in Mobile. I'm wondering if anyone else has run into this problem and come up with a solution, I don't want to have to add eventHandlers all over to capture the scroll event.

Here is an example of my code:

<ReactToolTip 
    multiline={true}
    scrollHide={true}
    scrollResize={true}
    class="tipOverrides"
    id={tipid}
    effect="solid"
    place='top' 
    type='info'/>

I'm trying to use the scrollHide and scrollResize events according to docs.

ryan-hamblin avatar Jan 30 '17 22:01 ryan-hamblin

scrollHide is actually not working at all for me (on desktop). Are you using a single top-level <ReactTooltip> element?

philraj avatar Feb 15 '17 21:02 philraj

+1 to scrollHide not working (on desktop), not using a single top-level element.

ajritch avatar Mar 20 '17 20:03 ajritch

Hey guys, can this issue be reproduced at the examples page? I can see that the left tooltip of the "Theme and delay" section reproduces the same issue. But that issue caused by delayHide.

Please, provide more information how to reproduce this.

huumanoid avatar Mar 20 '17 21:03 huumanoid

to clarify @philraj and along with what @ajritch said, I'm not using this as a top level element at all. It's actually being used on a table that lazy loads rows "Fixed-Data-Table" to be exact. I ended up re writing the table and building my own tooltip. haha good ol' fashioned work around/work through.

@huumanoid to reproduce, simply install the element, hover to activate and show the tooltip, and start scrolling. It wont go away. :)

ryan-hamblin avatar Mar 21 '17 15:03 ryan-hamblin

@huumanoid No, can't reproduce it with the examples given. It might be because I'm using the tooltips within overflow: scroll containers in my project. Are you able to test that case? I don't have time to test it myself unfortunately.

I am using a single <ReactTooltip/> component but that doesn't seem to be the deciding factor here.

philraj avatar Mar 21 '17 16:03 philraj

Thanks guys. I think I've catched it. I'm going to fix it in 3.2.11 or 3.2.12.

<div id="root">
  <ReactTooltip />
  <div style={{ width: '5000px'; height: '5000px' }} />
</div>

huumanoid avatar Mar 29 '17 00:03 huumanoid

This problem solved?

guzhavin avatar Sep 21 '17 09:09 guzhavin

I believe so. Should I close the issue?

ryan-hamblin avatar Sep 21 '17 16:09 ryan-hamblin

@ryanhca I see this bug in the current version.

guzhavin avatar Sep 21 '17 17:09 guzhavin

Based on a comment in #291, there is a work-around. add data-iscapture="true" to your tooltip target. I'm not sure what other implications this has, though.

aronhelser avatar Apr 17 '18 15:04 aronhelser

:tada: This issue has been resolved in version 3.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

aronhelser avatar May 03 '18 18:05 aronhelser

@aronhelser As of 3.6.0, this is still not working for me by adding the attributes data-scroll-hide on the tooltip and scrollHide on the ReactTooltip component. Unless the intention is that it waits until scrolling is stopped before the tooltip is removed.


Ah, I see it is only failing to work when you set a delayHide. Is this a bug?

thomashibbard avatar Jun 07 '18 20:06 thomashibbard

I'm not sure I understand, but it could be. What behavior do you expect if you set both delayHide and scrollHide? Based on the behavior of the tooltip in the "Theme and Delay" section of the demo (http://wwayne.com/react-tooltip/) I think the tooltip hanging around for the delay after a scroll is the expected behavior.

aronhelser avatar Jun 07 '18 20:06 aronhelser

@aronhelser I wouldn't think so. If a user scrolls down the page for several seconds (slowly, or it's a large page) the tooltip will remain positioned in its static position on the page for the entire time. It's really odd looking (ie, looks buggy) to just have it hanging out there for the entire duration of the scroll. For me it should disappear after scroll-start + delay, or have its own delay entirely.

thomashibbard avatar Jun 07 '18 21:06 thomashibbard

Can you file a new issue?

On Thu, Jun 7, 2018 at 5:59 PM, Thomas Hibbard [email protected] wrote:

@aronhelser https://github.com/aronhelser I wouldn't think so. If a user scrolls down the page for several seconds (slowly, or it's a large page) the tooltip will remain positioned in its static position on the page for the entire time. It's really odd looking (ie, looks buggy) to just have it hanging out there for the entire duration of the scroll. For me it should disappear after scroll-start + delay, or have its own delay entirely.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wwayne/react-tooltip/issues/248#issuecomment-395579117, or mute the thread https://github.com/notifications/unsubscribe-auth/AS_pneOra_fh7iwHvkpVJ3aU2VHEWcXnks5t6aJYgaJpZM4Lx_LX .

aronhelser avatar Jun 08 '18 12:06 aronhelser

I am still facing this issue in 3.6.1

essaji avatar Jul 24 '18 09:07 essaji

We are still see this issue in v3.9.2.

yarik-vv avatar Feb 01 '19 10:02 yarik-vv

I am still see this issue in v3.10.0 if I set delayHide

Ah, I see it is only failing to work when you set a delayHide. Is this a bug?

umihui avatar Apr 12 '19 07:04 umihui

I think this issue arising due to combination of delayHide and scroll is being tracked under #474, for others who stumble here on this issue for this, lets use Issue 474 for adding comments, up-voting and further analysis/PR.

kashifshamaz21 avatar May 03 '19 15:05 kashifshamaz21

Based on a comment in #291, there is a work-around. add data-iscapture="true" to your tooltip target. I'm not sure what other implications this has, though.

If the event target is an SVG, the tooltip will appear only on hovering over the strokes. Can easily be fixed:

  svg {
    pointer-events: all;
  }

filipkowal avatar Dec 07 '21 17:12 filipkowal