Twitter Bootstrap Popover/Tooltip Bug with Mobile?

后端 未结 6 1140
执念已碎
执念已碎 2021-02-19 05:24

I am working with Twitter Bootstrap and ran into something I could not fix when testing on iPad and iPhone. On mobile (at least those devices) you need to click to engage the t

6条回答
  •  無奈伤痛
    2021-02-19 06:10

    I had the same problem with my IPad. But in browser it works fine. Solution for me was adding listeners for all possible element that i can hide tooltip:

    $('*').bind('touchend', function(e){
       if ($(e.target).attr('rel') !== 'tooltip' && ($('div.tooltip.in').length > 0)){
         $('[rel=tooltip]').mouseleave();
         e.stopPropagation();
       } else {
         $(e.target).mouseenter();
       }
    });
    

    Yes, it's small overhead to send event for all tooltips, but you can't define which element tooltip is showing.

提交回复
热议问题