bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Tooltip does not close on IPhone

Open michaelhunziker opened this issue 12 years ago • 14 comments

Dear all!

We are using angular-ui bootstrap in our project. Our application also needs to be responsive.

I just tested angular ui bootstrap tooltips on an IPhone (IPhone 5, IOs 7) and it does not seem to work (just open the following URL on an IPhone: http://angular-ui.github.io/bootstrap/). The tooltip opens correctly on click but I am not able to close it anymore. It all works on Android (e.g. Nexus 5 phone).

Any idea how I could fix this? Is this a known issue?

Cheers Michael

michaelhunziker avatar Apr 30 '14 12:04 michaelhunziker

Hi all!

Am I the only one having the issue?

Cheers Michael

michaelhunziker avatar May 15 '14 05:05 michaelhunziker

It seems like other libraries have had the issue too:

http://bugs.jqueryui.com/ticket/8850 https://github.com/twbs/bootstrap/issues/3417

but I'm having difficulties applying a fix for this in angular-ui

michaelhunziker avatar May 15 '14 05:05 michaelhunziker

Hey Micahel, late but never the less i did find an answer, assuming your troubles are when using the tooltip on mouseover/out events.

iOS Safari emulates the necessary mouseout event on the preceeding element (that is, the element, that you have first clicked) only when the new element (or any of its parents) are considered "clickable". You can promote any element to a "clickable" element by attaching an event handler, e.g. onclick="void(0)".

Sources: https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html http://sitr.us/2011/07/28/how-mobile-safari-emulates-mouse-events.html

m0x72 avatar Oct 10 '14 09:10 m0x72

@m0x72 You're great!! Thanks! I'll try it out :-)

michaelhunziker avatar Nov 04 '14 12:11 michaelhunziker

@m0x72 I can't get the tooltip to close on an IPhone... I created the following Fiddle: http://jsfiddle.net/mhu23/1utogydx/19

The tooltip should close when I click somewhere else (as it does with an Android)

Do you have any ideas?

michaelhunziker avatar Nov 05 '14 07:11 michaelhunziker

@michaelhunziker You will want to put the event handler on a parent element, such that clicking it will trigger a mouseout on the tooltip element and a mouseover event on the parent.

Hope this fiddle helps: http://jsfiddle.net/soghq0pr/2/

m0x72 avatar Nov 05 '14 10:11 m0x72

@m0x72 worked for me! thanks!

scrivy avatar Jun 02 '15 21:06 scrivy

@m0x72 I've been battling with this for days and glad I found this to be the closest to a working solution. However, It's still doesn't work for my case. The only difference between mine and the jsfiddle you had was that mine I have this as a config. Any helps is really appreciated.

.config(['$tooltipProvider', function($tooltipProvider) {
    $tooltipProvider.options({
        placement: 'bottom',
        animation: true,
        popupDelay: 0,
        appendToBody: true
    });
}])

tdogg137 avatar Jun 09 '15 05:06 tdogg137

I tested this on the iOS simulator, and the tooltips appear to work. However, note that hovering over will be dicey on iOS, so once needs to use a trigger like click or focus.

Closing as fixed.

wesleycho avatar Aug 03 '15 06:08 wesleycho

solution http://jsfiddle.net/stereotipo/suhq88b0/17/

test on iOS (ipad and iphone), android and windows

ddalairac avatar Oct 07 '15 16:10 ddalairac

@wesleycho Interestingly, it works on the simulator in Safari, but not in a UIWebView within an app (e.g. if using Cordova).

theblang avatar Apr 04 '16 19:04 theblang

@mattblang, we have decided that as a project, tooltips and popovers, in general, are not going to be supported as from a UX perspective it makes almost zero sense. I can see a use case for click enabled popovers for, say, editing an item, but again, from a UX perspective, this behavior/usage just comes across as really bad.

icfantv avatar Apr 04 '16 20:04 icfantv

@icfantv i think there is a legitimate use case for contextual information if you you open them via tap and the tapability is indicated in a good way.

johannesjo avatar Nov 09 '16 10:11 johannesjo

We have a similar issue, if I have understand all comments correctly. We tap in iPhone or Android app on a tooltip, it appears, but then the only way to make it dissapear is taping on another tooltip.

If I have understand correctly @icfantv comment, this is not going to be "fixed"?

Thanks in advance for all support!

sauldeleon avatar May 29 '17 05:05 sauldeleon