Skip to content

Tooltips cannot be dismissed on iOS #16028

Closed

Description

@upngo

Tooltips can be shown on mobile by clicking, but you cant get rid of them.

They swallow up click events too so you can't add click handlers to the body to hide them.

Same as the problem noted in #3417 #6232 - both full of exasperated users..

If this isn't going to be fixed, at least a note could be put in the docs saying don't use tooltips if you want it to work on mobile without custom code disabling them for mobile devices...

Activity

  1. added
    js
    on Mar 9, 2015
  2. changed the title [-]Tooltips still dont work on mobile[/-] [+]Tooltips cannot be dismissed on mobile[/+] on Mar 9, 2015
  3. cvrebert commented on Mar 10, 2015

    @cvrebert
    Collaborator

    You're referring only to iOS and not Android, correct?

    We could give body { cursor: pointer; } a try.

  4. upngo commented on Mar 10, 2015

    @upngo
    Author

    Yes. That would make it more intuitive for iOS users but the problem is you
    can't get them to disappear after the tap on iOS

    On Tuesday, 10 March 2015, Chris Rebert [email protected] wrote:

    You're referring only to iOS and not Android, correct?

    We could give body { cursor: pointer; }
    https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
    a try.

    —
    Reply to this email directly or view it on GitHub
    #16028 (comment).

  5. cvrebert commented on Mar 10, 2015

    @cvrebert
    Collaborator

    Uh, no, I mean that should literally theoretically (with some minor additional changes) fix the dismissibility problem. See linked article.

  6. upngo commented on Mar 10, 2015

    @upngo
    Author

    Woops! True, that's convenient. Good find

    On Tuesday, 10 March 2015, Chris Rebert [email protected] wrote:

    Uh, no, I mean that should literally theoretically fix the dismissibility
    problem. See linked article.

    —
    Reply to this email directly or view it on GitHub
    #16028 (comment).

  7. changed the title [-]Tooltips cannot be dismissed on mobile[/-] [+]Tooltips cannot be dismissed on iOS[/+] on Mar 12, 2015
  8. added
    confirmed
    on Apr 27, 2015
  9. fat commented on Apr 27, 2015

    @fat
    Member

    @cvrebert is this a css issue?

  10. cvrebert commented on Apr 27, 2015

    @cvrebert
    Collaborator
  11. fat commented on Apr 27, 2015

    @fat
    Member

    @cvrebert i just meant more, that if we wanted to pursue a fix, woudl we just add that css snippet to the tooltip component… or did you expect the js to fix this somehow? (label wise)

  12. cvrebert commented on May 20, 2015

    @cvrebert
    Collaborator

    @fat I guess it would need to be in the JS. Something like:

    if ('ontouchstart' in document.documentElement) { // or whatever "is this a touch device?" test we want to use
      $('body').css('cursor', 'pointer');
    }
  13. patrickhlauke commented on May 20, 2015

    @patrickhlauke
    Member

    or whatever "is this a touch device?" test we want to use

    there is no bullet-proof way for this part though...and it would likely cause quirky effects on hybrid devices like touch-enabled laptops, surface, etc

  14. cvrebert commented on May 20, 2015

    @cvrebert
    Collaborator

    I guess we'd ought to toss in some iOS Safari detection/UA-sniffing for good measure.

  15. kkirsche commented on May 20, 2015

    @kkirsche
    Contributor

    @cvrebert Why not just use the Touch object safari defines on mobile?

    // Safari Mobile
    if(window.Touch) { /* JavaScript for your touch interface */ }
  16. 40 remaining items

  17. patrickhlauke commented on Apr 20, 2017

    @patrickhlauke
    Member

    not tested this yet, but as a note: adding a touchstart to the body indiscriminately will lead to bad scroll performance (since the browser can then only scroll sync rather than async, and can't thread), unless using passive event listeners (which removes the problem, but only in modern supporting browsers)

  18. patrickhlauke commented on Apr 20, 2017

    @patrickhlauke
    Member

    #22481 ports the same hack i used for dropdowns to tooltips. while hacky, it's relatively small and has no known side-effects - all it does is coax iOS into doing event delegation/bubbling like all other touch-enabled browsers (grumble grumble)

  19. PlPadraig commented on Sep 1, 2017

    @PlPadraig

    @gregblass I checked out https://github.com/sandywalker/webui-popover and it worked for me as well right out of the box! Thanks! That saved me a lot of time in resolving this problem in my application.

  20. turigeza commented on Jan 18, 2018

    @turigeza

    I ended up with this so far so good ...
    @supports (-webkit-overflow-scrolling: touch) { /* CSS specific to iOS devices */ body{ cursor:pointer; } }

    credit to:
    https://stackoverflow.com/questions/30102792/css-media-query-target-only-ios-devices

  21. added a commit that references this issue on Apr 11, 2018
  22. Joyrex commented on Jun 29, 2018

    @Joyrex

    While @turigeza solution works so tooltips are dismissible, this is only for iOS Safari, and in cases where a button invokes a modal or similar, the tooltip remains until you tap elsewhere.

    I really think a solution that targets touch-enabled devices (not just iOS Safari) that auto-dismisses a tooltip after [x] seconds would be the best, and with Bootstrap 4 being mobile-first, I think should be part of the framework.

  23. patrickhlauke commented on Jun 29, 2018

    @patrickhlauke
    Member

    so let's be clear...is there still a current issue even after fixes etc? if so, please file a fresh issue with a reduced test case

  24. chrisbo commented on Jun 29, 2018

    @chrisbo

    I agree with Joyrex. I have just removed every single tooltip from a site because I noticed in iOS they stack and won't go away.

  25. Joyrex commented on Jun 29, 2018

    @Joyrex

    @patrickhlauke - well, yes - there really never was an adequate “fix” to begin with, for the reasons I pointed out.

  26. patrickhlauke commented on Jun 30, 2018

    @patrickhlauke
    Member

    and again, i'll ask you to post a reduced test case to show the issue, and post a fresh issue. the workaround implemented at the time covered the common scenario of tooltips like http://getbootstrap.com/docs/4.1/components/tooltips/#examples and they work fine on iOS. if there's further situations that currently fail...post a new issue instead of adding to a closed thread started in 2015

  27. BonBonSlick commented on Sep 26, 2018

    @BonBonSlick

    On iOS after click tooltip does not disappear BS 3.

  28. kiler129 commented on Oct 9, 2018

    @kiler129

    @turigeza: FYI, this no longer works :(

  29. Johann-S commented on Oct 10, 2018

    @Johann-S
    Member

    If you have an issue please create a new one with a live test on a CodePen thanks

  30. locked and limited conversation to collaborators on Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedjsv4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions