720kb / angular-tooltips

Angularjs tooltips module, add tooltips to your elements - https://720kb.github.io/angular-tooltips
351 stars 157 forks source link

Disable tooltip on mobile/touch #198

Closed david-genger closed 7 years ago

david-genger commented 7 years ago

I would like to disable the tooltip on mobile/touch devices. I have the tooltips on buttons/icons, and on mobile I need to click twice in order for the click event to trigger the action of the button, the first click is considered for a hover and it triggers the tooltip and the second click triggers the normal click.

45kb commented 7 years ago

@pdg6805 One thing you can try for sure is add tooltip-hide-trigger="touchstart touchend", that way should work as you expecting.

Or you could just create a css class for this based on media queries, the tooltip is shown by toggling css classes so you can do whatever.

Otherwise you can use tooltip-show="false" when you want to hide it, just work around and you'll find a simple solution i am sure ;)

RacerDelux commented 7 years ago

@45kb So I tried adding tooltip-hide-trigger="touchstart touchend" - but it did not seem to change anything. Tooltip still displayed. The issue this is causing is that on mobile, the tooltip being shown consumes the press, making all buttons require two presses.... And the tooltip is not even on the button, it is on the span inside the button.


Want to confirm, unless anything changes, making a class to hide the tooltip is the best method. @media (max-width: 799px){ tip { display: none !important; } }