Skip to content

Twitter Bootstrap Popover/Tooltip Bug with Mobile #6232

Closed

Activity

  1. Lechus commented on Dec 18, 2012

    @Lechus

    +1
    :hover - can not close on iphone.

    I am testing:

    if (mobile)
            {
                $(".thumbnail").on("click", "",  function(event){
                    $(this).mouseleave();
                    event.stopPropagation();
                });
            }
    
  2. mdo commented on Dec 28, 2012

    @mdo
    Member

    Don't rely on tooltips for mobile, and popovers should be done on click (the default as of a few versions ago).

  3. mnapoli commented on Dec 28, 2012

    @mnapoli
    Author

    @mdo Why are you closing this again -_-

    Don't rely on tooltips for mobile

    How do you do to enable tooltips only on mouse-less devices?? Basically you are closing the bug saying "Don't use tooltips if your website will be seen on mobiles".

    I don't get why you closed it! Using the most simple example, tooltips and popovers are preventing buttons and links to work on touch devices:

    <a class="example" title="Popover" href="/test">Test</a>​
    $(".example").popover();

    I am quoting myself:

    my buttons don't work on the first click because that click opens the popover/tooltip.
    I wish those functionalities would be automatically disabled on touch screens (because tooltip and popovers are useless on them).

    Do you see the problem? Will you reopen the bug (or at leaste provide a real explanation?)

  4. reopened this on Dec 28, 2012
  5. fat commented on Feb 6, 2013

    @fat
    Member

    @mnapoli relax.

    if you want to disable the show functionality on mobile tooltips, you should be able to just listen to tooltips show events and prevent default… give that a shot and let me know if that helps

    $(".elements-with-tooltips").on('show', function (e) {
      if ('ontouchstart' in document.documentElement) e.preventDefault()
    })

    Otherwise, you could also try asking in the mailing list.

    This isn't really a bug, I'm sure you can get something working 👍

  6. kevinastone commented on Feb 12, 2013

    @kevinastone

    Why is this not a bug? Tooltips block the button click events on touch-enabled devices. That hardly can be expected behavior requiring a second click event to trigger the button.

    This should be handled by the bootstrap tooltip plugin, I shouldn't have to patch the event handler.

  7. kevinastone commented on Feb 12, 2013

    @kevinastone

    I resolved this issue by checking for 'ontouchstart' in enter method. I would think this makes sense as a default.

      , enter: function (e) {
          if (this.options.trigger == 'hover' && 'ontouchstart' in document.documentElement) {
            // Block tooltip event on touch devices since it swallows click events
            return;
          }
          ...
    
  8. mnapoli commented on Feb 13, 2013

    @mnapoli
    Author

    @kevinastone +1, that's what I've been trying to say. Tooltips block links and buttons on touch devices, I fail to see how this is a feature.

    But this issue keep getting closed so what can we say

  9. gsmethells commented on Apr 26, 2013

    @gsmethells

    We are writing an app that is intended to be used from either a Desktop browser or a Tablet browser. Tooltips do block links and buttons on touch devices. From a Desktop browser, everything works as expected. From a Tablet browser, the first click creates the tooltip and the second fires the button event.

    I do not understand how you can say "do not use them" when many apps will target both platforms with a single code base. This is a bug as the behavior is not desirable.

  10. jaseemabid commented on Sep 25, 2013

    @jaseemabid

    Any update on this?

  11. philiposborne commented on Mar 13, 2014

    @philiposborne

    Once again @fat and @mdo collaborate to close an issue that everyone else is still saying is an issue. Virtually every issue I try to find an answer for I come across a thread that has been closed by those two with a long list of other people saying: "Listen to the logic of what we're ALL saying, THIS IS AN ISSUE!!!"

  12. mdo commented on Mar 14, 2014

    @mdo
    Member

    @DiscoverySquare There's no need to be upset—this issue is a year old. Anything discussed here code-wise is likely wildly out of date as we've since released a major rewrite of the code base.

    Beyond that, we're fully aware of some of the limitations we have right now with mobile and tooltips/plugins. In particular, there's some hairy situations with :hover and more. There's no easy fix here, but we're aware of them, and when we can, we'll fix them in the best way possible.

    Until then, if there is a problem in the current version of Bootstrap that hasn't been addressed by @fat's earlier comment here, open a new issue. Cite this one, your reasons for opening a new one, include a JS Bin link if need be, and make your case.

    <3

  13. locked and limited conversation to collaborators on Jul 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    js

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions