You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...
Reacted by Steven Barragán Naranjo, Ahmer and Patrick Wallesch
Reacted by johnnyluu, Christian Sleight, Chris Cooley, Hwasung Kim, Justin McDonald, pPrech, Ievgenii Syrotenko, Luca Boieru, Ran Leonard, vitalii-shulhin and 1 more
Reacted by Mohammed Khomakho
Reacted by Christian Sleight, Chris Cooley, Tomáš Šromovský, Luca Boieru, Mohammed Khomakho, Olsi Odobashi and vitalii-shulhin
@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)
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
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)
#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)
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.
Activity
[-]Tooltips still dont work on mobile[/-][+]Tooltips cannot be dismissed on mobile[/+]cvrebert commentedon Mar 10, 2015
You're referring only to iOS and not Android, correct?
We could give
body { cursor: pointer; }a try.upngo commentedon Mar 10, 2015
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:
cvrebert commentedon Mar 10, 2015
Uh, no, I mean that should literally theoretically (with some minor additional changes) fix the dismissibility problem. See linked article.
upngo commentedon Mar 10, 2015
Woops! True, that's convenient. Good find
On Tuesday, 10 March 2015, Chris Rebert [email protected] wrote:
[-]Tooltips cannot be dismissed on mobile[/-][+]Tooltips cannot be dismissed on iOS[/+]fat commentedon Apr 27, 2015
@cvrebert is this a css issue?
cvrebert commentedon Apr 27, 2015
@fat It's an iOS Safari quirk/bug: https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
fat commentedon Apr 27, 2015
@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)
cvrebert commentedon May 20, 2015
@fat I guess it would need to be in the JS. Something like:
patrickhlauke commentedon May 20, 2015
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
cvrebert commentedon May 20, 2015
I guess we'd ought to toss in some iOS Safari detection/UA-sniffing for good measure.
kkirsche commentedon May 20, 2015
@cvrebert Why not just use the
Touchobject safari defines on mobile?40 remaining items
patrickhlauke commentedon Apr 20, 2017
not tested this yet, but as a note: adding a
touchstartto thebodyindiscriminately 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)patrickhlauke commentedon Apr 20, 2017
#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)
PlPadraig commentedon Sep 1, 2017
@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.
turigeza commentedon Jan 18, 2018
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
add browser specific workaround
Joyrex commentedon Jun 29, 2018
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.
patrickhlauke commentedon Jun 29, 2018
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
chrisbo commentedon Jun 29, 2018
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.
Joyrex commentedon Jun 29, 2018
@patrickhlauke - well, yes - there really never was an adequate “fix” to begin with, for the reasons I pointed out.
patrickhlauke commentedon Jun 30, 2018
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
BonBonSlick commentedon Sep 26, 2018
On iOS after click tooltip does not disappear BS 3.
kiler129 commentedon Oct 9, 2018
@turigeza: FYI, this no longer works :(
Johann-S commentedon Oct 10, 2018
If you have an issue please create a new one with a live test on a CodePen thanks