Disable Tooltips on Touch Device #2525
Comments
i've had success here by configuring the tooltipProvider to return nothing when touch features are detected: // configure the tooltipProvider
}]) |
I've had success implementing this based on this part of the source code: "If the To detect if the device is a touch device, I used a user agent string parser like this library to get the device type, and made the assumption that if the device type is
|
Thanks! |
Looks like OP's question has been answered. Thanks to the community members who pitched in and helped him out. |
@dust4ngel Thanks for sharing your solution. I actually needed to do it that way because I needed to inject the deviceDetector service so I can check for mobile devices by doing deviceDetector.isMobile(). |
@AParks Thanks for your clever idea! It looks like we have |
@AParks I'm trying to get your solution to work, unfortunately I'm getting Uncaught Error: [$injector:modulerr] all the time. Any idea, what i'm doing wrong? |
@shuhei nice! I'm still using bootstrap version 0.12.1, which doesn't have that |
@aslepiak ah I bet it's because there was a syntax error! It should be var options = {
trigger: 'dontTrigger'; // default dummy trigger event to show tooltips
}; instead of var options = {
trigger = 'dontTrigger'; // default dummy trigger event to show tooltips
}; Sorry about that! I've updated the original post. |
@AParks @shuhei
It's worth mentioning, that $tooltipProvider changed name to $uibTooltipProvider in the meantime. It would be really nice, if we had an option to disable popovers on mobile, since:
Anyway big thanks to everyone posting in this thread (especially AParks). I'd never done this myself :) |
@aslepiak 's solution no longer works. 'trigger' is not a property that can be globally configured, and neither is 'enable.' A very big disappointment for me, since it looks like I will have to add the tooltip-enable or tooltip-trigger attributes to every since use of the tooltip across the site. Does anyone have another global solution? |
How would one disable tooltips in touch devices (tablets/phones)? I love using angular-ui bootstrap, but users on touch devices to click tooltip-enabled buttons twice (once to display the tooltip, next to take action). Hiding it using CSS and @media queries doesn't work because technically the tooltip is still there, it's just not visible. Any thoughts?
The text was updated successfully, but these errors were encountered: