question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tooltip appears on click and is not dismissed on iOS mobile

See original GitHub issue

Hi,

First, thanks for this library!

I’m using this on iOS mobile, there are two issues I am noticing right now:

  1. An element that is hovered over on the desktop browser and displays the tooltip, will show the tooltip when clicked on in mobile iOS

  2. the tooltip that appears after the element is clicked does not go away without scrolling the page

I’m guessing this might have something to do with the event listeners, maybe it needs support for touch events? I can help troubleshoot, but wanted to submit this just in case anyone else has run into it and what the best solution would be.

This is reproducible with the example page by opening it in iOS simulator for iPhone. http://wwayne.com/react-tooltip/

Update 1: Doing something like:

var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
if (isMobile) {
    return;
}

in showTooltip fixes the issue. Not sure how you would feel about adding this.

Cheers.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
codenameyaucommented, Oct 17, 2017

There is a known issue with iOS safari where click events aren’t being fired on non interactive elements, e.g. divs and spans.

See: https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile

I used a combination of the solutions above and cursor: 'pointer' to solve this issue for me:

const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);

<ReactTooltip 
  style={{ cursor: 'pointer' }} 
  globalEventOff={ isMobile ? 'touchstart' : undefined } 
/>
6reactions
elodszoposcommented, Dec 19, 2016

I solved this using globalEventOff={isMobile() ? 'click' : undefined} passed to the React-Tooltip component.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tooltip appears on click and is not dismissed on iOS mobile #203
I'm using this on iOS mobile, there are two issues I am noticing right now: An element that is hovered over on the...
Read more >
Bootstrap's tooltip doesn't disappear after button click ...
I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem.
Read more >
ARIA: tooltip role - Accessibility - MDN Web Docs - Mozilla
A tooltip is a contextual text bubble that displays a description for an element that appears on pointer hover or keyboard focus.
Read more >
Popovers - Presentation - Human Interface Guidelines - Design
A popover is a transient view that appears above other content onscreen when people ... People can unintentionally dismiss a nonmodal popover by...
Read more >
Modal - Bootstrap
For modals that simply appear rather than fade in to view, remove the .fade class from your modal markup. Copy. <div class="modal" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found