Tooltip does not close on IPhone
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
Hi all!
Am I the only one having the issue?
Cheers Michael
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
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 You're great!! Thanks! I'll try it out :-)
@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 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 worked for me! thanks!
@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
});
}])
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.
solution http://jsfiddle.net/stereotipo/suhq88b0/17/
test on iOS (ipad and iphone), android and windows
@wesleycho Interestingly, it works on the simulator in Safari, but not in a UIWebView within an app (e.g. if using Cordova).
@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 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.
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!