Bootstrap's tooltip doesn't disappear after button click & mouseleave












81















I have a problem with bootstrap's tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem. Is there any solution to fix this? Just tried in latest FF, IE.










share|improve this question

























  • It's not working in link in my question too, let's look there. There is the same problem.

    – SilentCry
    Nov 7 '15 at 17:51
















81















I have a problem with bootstrap's tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem. Is there any solution to fix this? Just tried in latest FF, IE.










share|improve this question

























  • It's not working in link in my question too, let's look there. There is the same problem.

    – SilentCry
    Nov 7 '15 at 17:51














81












81








81


14






I have a problem with bootstrap's tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem. Is there any solution to fix this? Just tried in latest FF, IE.










share|improve this question
















I have a problem with bootstrap's tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstrap's tooltip and if I'm clicking on the buttons, I see the same problem. Is there any solution to fix this? Just tried in latest FF, IE.







javascript twitter-bootstrap tooltip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 2 '17 at 10:05









Yangshun Tay

11.3k54582




11.3k54582










asked Nov 7 '15 at 15:26









SilentCrySilentCry

5621618




5621618













  • It's not working in link in my question too, let's look there. There is the same problem.

    – SilentCry
    Nov 7 '15 at 17:51



















  • It's not working in link in my question too, let's look there. There is the same problem.

    – SilentCry
    Nov 7 '15 at 17:51

















It's not working in link in my question too, let's look there. There is the same problem.

– SilentCry
Nov 7 '15 at 17:51





It's not working in link in my question too, let's look there. There is the same problem.

– SilentCry
Nov 7 '15 at 17:51












14 Answers
14






active

oldest

votes


















171














This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



$('[data-toggle="tooltip"]').tooltip({
trigger : 'hover'
})


the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/






share|improve this answer





















  • 1





    Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

    – SilentCry
    Nov 7 '15 at 18:08








  • 1





    @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

    – phk
    Nov 7 '15 at 23:10






  • 3





    @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

    – phk
    Nov 7 '15 at 23:19






  • 2





    @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

    – davidkonrad
    Nov 7 '15 at 23:34








  • 1





    You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

    – David Stosik
    Oct 16 '16 at 5:50



















42














I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:



$('[rel="tooltip"]').on('click', function () {
$(this).tooltip('hide')
})


This also shows the tooltip again upon hover.






share|improve this answer



















  • 1





    This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

    – kjdion84
    Jan 30 '17 at 12:57






  • 4





    This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

    – bradykey
    Feb 23 '17 at 22:51













  • In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

    – HPWD
    Sep 5 '17 at 15:13













  • I agree with @kjdion84 . I have been struggling until I found this

    – Ahmad
    Mar 14 '18 at 12:39



















8














In my case the issue was reproduced only in Internet Explorer: no matter which element(input, div etc...) has tooltip- if clicked- tooltip remains shown.



found some solutions on web that recommends .hide() that tooltip on elements Click event- but it is bad idea- hovering back to the same element - keeps it hidden...
in my case



$('.myToolTippedElement').on('click', function () {
$(this).blur()
})


made all the magic!!!- where .myToolTippedElement is the element that have a tooltip ofCourse...






share|improve this answer
























  • Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

    – David Stosik
    Oct 16 '16 at 5:48



















8














Hi i have little solution for this issue. When other solutions doesn't work just try this one:



$('body').tooltip({
selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
trigger: 'hover',
container: 'body'
}).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
$('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
});


This is solution for drag and drop too.
So i hope this help someone :)






share|improve this answer
























  • I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

    – John81
    May 3 '18 at 22:39











  • Same issue with ASP.Net button. This solved it.

    – Ahmer Ali Ahsan
    Nov 8 '18 at 10:29



















2














Try using rel="tooltip" instead of data-toggle="tooltip" which worked in my case. I was using data-toggle="tooltip" and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.



HTML Code:



<button id="submit-btn" type="submit" class="btn btn-success" rel="tooltip" title="Click to submit this form">Submit</button>


JS Code
//Tooltip
$('.btn').tooltip({
trigger: 'hover'
});



This will definitely remove the stuck tooltip.






share|improve this answer































    2














    David's answer above helped to fix my problem.
    I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click.
    On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover.
    This is what I had:



    $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true}); 


    This is the fix:



    $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true, trigger: 'hover'}); 





    share|improve this answer
























    • It worked for me!

      – b1919676
      Dec 11 '17 at 9:24



















    1














    Also you can add:



    onclick="this.blur()"





    share|improve this answer





















    • 1





      how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

      – YakovL
      Mar 22 '18 at 8:16





















    0














    I'm using bootstrap tooltip in cycle.js and none of the above worked for me.



    I had to do this:



    return button( selector + '.btn.btn-sm', 
    {
    hook: {
    destroy: tooltipOff,
    insert: toggleTooltipOn,
    },
    ....

    function toggleTooltipOn(vnode){
    setupJQuery();
    jQuery[0].$( vnode.elm )
    .tooltip({container:'body', trigger: 'hover');
    //container:body is to help tooltips not wiggle on hover
    //trigger:hover is to only trigger on hover, not on click
    }

    function tooltipOff( vnode ){
    setupJQuery();
    jQuery[0].$( vnode.elm ).tooltip('hide');
    }





    share|improve this answer































      0














      This works for me :



      $(document).ready(function() {
      $('#save').tooltip({
      trigger : 'hover'
      }) ;

      });


      I was disabling save button dynamically then problem was.






      share|improve this answer


























      • Here save is id of my button

        – Devendra Singraul
        Nov 8 '17 at 10:58



















      0














      The way I fixed this issue was by removing the tooltip in the click event function using the following code:



      $("#myButton").on("click", function() {
      $("div[role=tooltip]").remove();
      });





      share|improve this answer



















      • 1





        can You ble get the tooltip again on hover?

        – Vishnu
        Jun 28 '18 at 11:55



















      0















      Inside your document ready function use this




       $(document).ready(function(){
      $('[data-toggle="tooltip"]').tooltip({
      trigger : 'hover'
      });
      });





      share|improve this answer































        0














        This solution worked for me.



        $('a[data-toggle="tooltip"]').tooltip({
        animated: 'fade',
        placement: 'bottom',
        trigger: 'click'
        });

        $('a[data-toggle="tooltip"]').click(function(event){
        event.stopPropagation();
        });

        $('body').click(function(){
        $('a[data-toggle="tooltip"]').tooltip('hide');
        });


        fiddle



        I tried most of the solutions given in previous answers, but none of them worked for me.






        share|improve this answer

































          0














          My problem is in DataTable. Below code works for me.




          columnDefs: [
          {
          targets: 0, data: "id",
          render: function (data, type, full, meta) {
          return '<a href="javascript:;" class="btn btn-xs btn-default" data-toggle="tooltip" title="Pending" data-container="body"><i class="fa fa-check"></i></a>';
          }
          }
          ],
          drawCallback: function() {
          $('[data-toggle="tooltip"]').tooltip();
          $('[data-toggle="tooltip"]').on('click', function () {
          $(this).tooltip('hide');
          });
          }






          share|improve this answer































            0














            You can also use below method to hide tooltip on mouseleave, As below:



            jQuery("body").on("mouseleave", ".has-tooltip", function(){
            jQuery(this).blur();
            });





            share|improve this answer


























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f33584392%2fbootstraps-tooltip-doesnt-disappear-after-button-click-mouseleave%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              14 Answers
              14






              active

              oldest

              votes








              14 Answers
              14






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              171














              This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



              So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



              $('[data-toggle="tooltip"]').tooltip({
              trigger : 'hover'
              })


              the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/






              share|improve this answer





















              • 1





                Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

                – SilentCry
                Nov 7 '15 at 18:08








              • 1





                @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

                – phk
                Nov 7 '15 at 23:10






              • 3





                @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

                – phk
                Nov 7 '15 at 23:19






              • 2





                @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

                – davidkonrad
                Nov 7 '15 at 23:34








              • 1





                You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:50
















              171














              This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



              So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



              $('[data-toggle="tooltip"]').tooltip({
              trigger : 'hover'
              })


              the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/






              share|improve this answer





















              • 1





                Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

                – SilentCry
                Nov 7 '15 at 18:08








              • 1





                @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

                – phk
                Nov 7 '15 at 23:10






              • 3





                @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

                – phk
                Nov 7 '15 at 23:19






              • 2





                @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

                – davidkonrad
                Nov 7 '15 at 23:34








              • 1





                You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:50














              171












              171








              171







              This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



              So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



              $('[data-toggle="tooltip"]').tooltip({
              trigger : 'hover'
              })


              the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/






              share|improve this answer















              This is because trigger is not set. The default value for trigger is 'hover focus', thus the tooltip stay visible after a button is clicked, until another button is clicked, because the button is focused.



              So all you have to do is to define trigger as 'hover' only. Below the same example you have linked to without persisting tooltips after a button is clicked :



              $('[data-toggle="tooltip"]').tooltip({
              trigger : 'hover'
              })


              the doc example in a fiddle -> http://jsfiddle.net/vdzvvg6o/







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 27 '18 at 12:09









              Stéphane Bruckert

              14.9k663103




              14.9k663103










              answered Nov 7 '15 at 18:03









              davidkonraddavidkonrad

              65.1k13141196




              65.1k13141196








              • 1





                Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

                – SilentCry
                Nov 7 '15 at 18:08








              • 1





                @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

                – phk
                Nov 7 '15 at 23:10






              • 3





                @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

                – phk
                Nov 7 '15 at 23:19






              • 2





                @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

                – davidkonrad
                Nov 7 '15 at 23:34








              • 1





                You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:50














              • 1





                Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

                – SilentCry
                Nov 7 '15 at 18:08








              • 1





                @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

                – phk
                Nov 7 '15 at 23:10






              • 3





                @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

                – phk
                Nov 7 '15 at 23:19






              • 2





                @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

                – davidkonrad
                Nov 7 '15 at 23:34








              • 1





                You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:50








              1




              1





              Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

              – SilentCry
              Nov 7 '15 at 18:08







              Thank you David, that really works. I misunderstood trigger option for tooltip in last, now I'm right.

              – SilentCry
              Nov 7 '15 at 18:08






              1




              1





              @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

              – phk
              Nov 7 '15 at 23:10





              @SilentCry Just keep in mind who you are targeting, triggering a "hover" might not always be easy/common.

              – phk
              Nov 7 '15 at 23:10




              3




              3





              @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

              – phk
              Nov 7 '15 at 23:19





              @davidkonrad Mobile platforms, blind users. Might also explain why they set 'hover focus' as the default.

              – phk
              Nov 7 '15 at 23:19




              2




              2





              @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

              – davidkonrad
              Nov 7 '15 at 23:34







              @phk, bootstrap has a general problem by not being mobile-first, regarding blind people we should use aria-attributes. There is BTW a great tool for testing for usability developed for the canadian authorities with several "levels" you can fulfill -> achecker.ca/checker/index.php my country does not have these standards, but it is worth keeping up to them anyway.

              – davidkonrad
              Nov 7 '15 at 23:34






              1




              1





              You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

              – David Stosik
              Oct 16 '16 at 5:50





              You might want to have a look at Karmonik Cola's answer below. It keeps showing the tooltip on focus.

              – David Stosik
              Oct 16 '16 at 5:50













              42














              I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:



              $('[rel="tooltip"]').on('click', function () {
              $(this).tooltip('hide')
              })


              This also shows the tooltip again upon hover.






              share|improve this answer



















              • 1





                This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

                – kjdion84
                Jan 30 '17 at 12:57






              • 4





                This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

                – bradykey
                Feb 23 '17 at 22:51













              • In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

                – HPWD
                Sep 5 '17 at 15:13













              • I agree with @kjdion84 . I have been struggling until I found this

                – Ahmad
                Mar 14 '18 at 12:39
















              42














              I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:



              $('[rel="tooltip"]').on('click', function () {
              $(this).tooltip('hide')
              })


              This also shows the tooltip again upon hover.






              share|improve this answer



















              • 1





                This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

                – kjdion84
                Jan 30 '17 at 12:57






              • 4





                This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

                – bradykey
                Feb 23 '17 at 22:51













              • In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

                – HPWD
                Sep 5 '17 at 15:13













              • I agree with @kjdion84 . I have been struggling until I found this

                – Ahmad
                Mar 14 '18 at 12:39














              42












              42








              42







              I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:



              $('[rel="tooltip"]').on('click', function () {
              $(this).tooltip('hide')
              })


              This also shows the tooltip again upon hover.






              share|improve this answer













              I know over a year old, but I couldn't get this to work with any examples here. I've had to use the following:



              $('[rel="tooltip"]').on('click', function () {
              $(this).tooltip('hide')
              })


              This also shows the tooltip again upon hover.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 8 '16 at 3:36









              NitaiNitai

              80067




              80067








              • 1





                This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

                – kjdion84
                Jan 30 '17 at 12:57






              • 4





                This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

                – bradykey
                Feb 23 '17 at 22:51













              • In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

                – HPWD
                Sep 5 '17 at 15:13













              • I agree with @kjdion84 . I have been struggling until I found this

                – Ahmad
                Mar 14 '18 at 12:39














              • 1





                This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

                – kjdion84
                Jan 30 '17 at 12:57






              • 4





                This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

                – bradykey
                Feb 23 '17 at 22:51













              • In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

                – HPWD
                Sep 5 '17 at 15:13













              • I agree with @kjdion84 . I have been struggling until I found this

                – Ahmad
                Mar 14 '18 at 12:39








              1




              1





              This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

              – kjdion84
              Jan 30 '17 at 12:57





              This needs to be the accepted answer and also should be implemented into the bootstrap codebase.

              – kjdion84
              Jan 30 '17 at 12:57




              4




              4





              This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

              – bradykey
              Feb 23 '17 at 22:51







              This was extremely helpful for bootstrap tooltips placed on buttons with a trigger of 'hover' that cause asynchronous postbacks (i.e. display modal panels). Without this, the postback from the button press causes the tooltip to get "stuck" and never disappear.

              – bradykey
              Feb 23 '17 at 22:51















              In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

              – HPWD
              Sep 5 '17 at 15:13







              In my case, I was disabling the submit button while an ajax action was performed. While the ajax process was running, the tooltip would remain since the button was disabled. Once the ajax process completed, the button would become "available" again. Hovering on and then off of the button would dismiss the tooltip. Nitai's solution fixed everything. The tooltip now hides upon click and still works on hover once the button becomes active again.

              – HPWD
              Sep 5 '17 at 15:13















              I agree with @kjdion84 . I have been struggling until I found this

              – Ahmad
              Mar 14 '18 at 12:39





              I agree with @kjdion84 . I have been struggling until I found this

              – Ahmad
              Mar 14 '18 at 12:39











              8














              In my case the issue was reproduced only in Internet Explorer: no matter which element(input, div etc...) has tooltip- if clicked- tooltip remains shown.



              found some solutions on web that recommends .hide() that tooltip on elements Click event- but it is bad idea- hovering back to the same element - keeps it hidden...
              in my case



              $('.myToolTippedElement').on('click', function () {
              $(this).blur()
              })


              made all the magic!!!- where .myToolTippedElement is the element that have a tooltip ofCourse...






              share|improve this answer
























              • Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:48
















              8














              In my case the issue was reproduced only in Internet Explorer: no matter which element(input, div etc...) has tooltip- if clicked- tooltip remains shown.



              found some solutions on web that recommends .hide() that tooltip on elements Click event- but it is bad idea- hovering back to the same element - keeps it hidden...
              in my case



              $('.myToolTippedElement').on('click', function () {
              $(this).blur()
              })


              made all the magic!!!- where .myToolTippedElement is the element that have a tooltip ofCourse...






              share|improve this answer
























              • Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:48














              8












              8








              8







              In my case the issue was reproduced only in Internet Explorer: no matter which element(input, div etc...) has tooltip- if clicked- tooltip remains shown.



              found some solutions on web that recommends .hide() that tooltip on elements Click event- but it is bad idea- hovering back to the same element - keeps it hidden...
              in my case



              $('.myToolTippedElement').on('click', function () {
              $(this).blur()
              })


              made all the magic!!!- where .myToolTippedElement is the element that have a tooltip ofCourse...






              share|improve this answer













              In my case the issue was reproduced only in Internet Explorer: no matter which element(input, div etc...) has tooltip- if clicked- tooltip remains shown.



              found some solutions on web that recommends .hide() that tooltip on elements Click event- but it is bad idea- hovering back to the same element - keeps it hidden...
              in my case



              $('.myToolTippedElement').on('click', function () {
              $(this).blur()
              })


              made all the magic!!!- where .myToolTippedElement is the element that have a tooltip ofCourse...







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jun 8 '16 at 14:03









              Kamornik ColaKamornik Cola

              155111




              155111













              • Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:48



















              • Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

                – David Stosik
                Oct 16 '16 at 5:48

















              Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

              – David Stosik
              Oct 16 '16 at 5:48





              Works for me too, and has the advantage over the accepted solution of keeping displaying the tooltip on focus.

              – David Stosik
              Oct 16 '16 at 5:48











              8














              Hi i have little solution for this issue. When other solutions doesn't work just try this one:



              $('body').tooltip({
              selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
              trigger: 'hover',
              container: 'body'
              }).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
              $('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
              });


              This is solution for drag and drop too.
              So i hope this help someone :)






              share|improve this answer
























              • I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

                – John81
                May 3 '18 at 22:39











              • Same issue with ASP.Net button. This solved it.

                – Ahmer Ali Ahsan
                Nov 8 '18 at 10:29
















              8














              Hi i have little solution for this issue. When other solutions doesn't work just try this one:



              $('body').tooltip({
              selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
              trigger: 'hover',
              container: 'body'
              }).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
              $('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
              });


              This is solution for drag and drop too.
              So i hope this help someone :)






              share|improve this answer
























              • I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

                – John81
                May 3 '18 at 22:39











              • Same issue with ASP.Net button. This solved it.

                – Ahmer Ali Ahsan
                Nov 8 '18 at 10:29














              8












              8








              8







              Hi i have little solution for this issue. When other solutions doesn't work just try this one:



              $('body').tooltip({
              selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
              trigger: 'hover',
              container: 'body'
              }).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
              $('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
              });


              This is solution for drag and drop too.
              So i hope this help someone :)






              share|improve this answer













              Hi i have little solution for this issue. When other solutions doesn't work just try this one:



              $('body').tooltip({
              selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
              trigger: 'hover',
              container: 'body'
              }).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
              $('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
              });


              This is solution for drag and drop too.
              So i hope this help someone :)







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 12 '17 at 10:22









              Nienormalny_Nienormalny_

              16418




              16418













              • I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

                – John81
                May 3 '18 at 22:39











              • Same issue with ASP.Net button. This solved it.

                – Ahmer Ali Ahsan
                Nov 8 '18 at 10:29



















              • I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

                – John81
                May 3 '18 at 22:39











              • Same issue with ASP.Net button. This solved it.

                – Ahmer Ali Ahsan
                Nov 8 '18 at 10:29

















              I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

              – John81
              May 3 '18 at 22:39





              I was having the problem only with Telerik Kendo grid buttons. When I clicked one, the tooltiip would not hide. This solved it!

              – John81
              May 3 '18 at 22:39













              Same issue with ASP.Net button. This solved it.

              – Ahmer Ali Ahsan
              Nov 8 '18 at 10:29





              Same issue with ASP.Net button. This solved it.

              – Ahmer Ali Ahsan
              Nov 8 '18 at 10:29











              2














              Try using rel="tooltip" instead of data-toggle="tooltip" which worked in my case. I was using data-toggle="tooltip" and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.



              HTML Code:



              <button id="submit-btn" type="submit" class="btn btn-success" rel="tooltip" title="Click to submit this form">Submit</button>


              JS Code
              //Tooltip
              $('.btn').tooltip({
              trigger: 'hover'
              });



              This will definitely remove the stuck tooltip.






              share|improve this answer




























                2














                Try using rel="tooltip" instead of data-toggle="tooltip" which worked in my case. I was using data-toggle="tooltip" and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.



                HTML Code:



                <button id="submit-btn" type="submit" class="btn btn-success" rel="tooltip" title="Click to submit this form">Submit</button>


                JS Code
                //Tooltip
                $('.btn').tooltip({
                trigger: 'hover'
                });



                This will definitely remove the stuck tooltip.






                share|improve this answer


























                  2












                  2








                  2







                  Try using rel="tooltip" instead of data-toggle="tooltip" which worked in my case. I was using data-toggle="tooltip" and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.



                  HTML Code:



                  <button id="submit-btn" type="submit" class="btn btn-success" rel="tooltip" title="Click to submit this form">Submit</button>


                  JS Code
                  //Tooltip
                  $('.btn').tooltip({
                  trigger: 'hover'
                  });



                  This will definitely remove the stuck tooltip.






                  share|improve this answer













                  Try using rel="tooltip" instead of data-toggle="tooltip" which worked in my case. I was using data-toggle="tooltip" and also set the trigger condition as hover which didn't work in my case. When I changed my data selector, it worked.



                  HTML Code:



                  <button id="submit-btn" type="submit" class="btn btn-success" rel="tooltip" title="Click to submit this form">Submit</button>


                  JS Code
                  //Tooltip
                  $('.btn').tooltip({
                  trigger: 'hover'
                  });



                  This will definitely remove the stuck tooltip.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 30 '16 at 15:51









                  Jestino SamJestino Sam

                  117214




                  117214























                      2














                      David's answer above helped to fix my problem.
                      I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click.
                      On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover.
                      This is what I had:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true}); 


                      This is the fix:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true, trigger: 'hover'}); 





                      share|improve this answer
























                      • It worked for me!

                        – b1919676
                        Dec 11 '17 at 9:24
















                      2














                      David's answer above helped to fix my problem.
                      I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click.
                      On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover.
                      This is what I had:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true}); 


                      This is the fix:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true, trigger: 'hover'}); 





                      share|improve this answer
























                      • It worked for me!

                        – b1919676
                        Dec 11 '17 at 9:24














                      2












                      2








                      2







                      David's answer above helped to fix my problem.
                      I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click.
                      On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover.
                      This is what I had:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true}); 


                      This is the fix:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true, trigger: 'hover'}); 





                      share|improve this answer













                      David's answer above helped to fix my problem.
                      I had both hover and click event on the button. Firefox on MAC did behave as I wanted. That is, show tooltip when hover, do not show tooltip for click.
                      On other browsers and OS, When I click, the tooltip appear and stay as show. Even if i move the mouse to other buttons for hover.
                      This is what I had:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true}); 


                      This is the fix:



                      $('[data-toggle="tooltip"]').tooltip({placement: 'right', html: true, trigger: 'hover'}); 






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Feb 14 '17 at 19:33









                      user1322977user1322977

                      7819




                      7819













                      • It worked for me!

                        – b1919676
                        Dec 11 '17 at 9:24



















                      • It worked for me!

                        – b1919676
                        Dec 11 '17 at 9:24

















                      It worked for me!

                      – b1919676
                      Dec 11 '17 at 9:24





                      It worked for me!

                      – b1919676
                      Dec 11 '17 at 9:24











                      1














                      Also you can add:



                      onclick="this.blur()"





                      share|improve this answer





















                      • 1





                        how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                        – YakovL
                        Mar 22 '18 at 8:16


















                      1














                      Also you can add:



                      onclick="this.blur()"





                      share|improve this answer





















                      • 1





                        how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                        – YakovL
                        Mar 22 '18 at 8:16
















                      1












                      1








                      1







                      Also you can add:



                      onclick="this.blur()"





                      share|improve this answer















                      Also you can add:



                      onclick="this.blur()"






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 22 '18 at 7:57









                      rollstuhlfahrer

                      3,26981831




                      3,26981831










                      answered Mar 22 '18 at 7:28









                      Sergey KoshkinSergey Koshkin

                      111




                      111








                      • 1





                        how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                        – YakovL
                        Mar 22 '18 at 8:16
















                      • 1





                        how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                        – YakovL
                        Mar 22 '18 at 8:16










                      1




                      1





                      how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                      – YakovL
                      Mar 22 '18 at 8:16







                      how this is different from what Kamornik Cola has proposed (except for implementation without jQuery)? I suggest to add some explanation for the answer to be helpful. Best regards

                      – YakovL
                      Mar 22 '18 at 8:16













                      0














                      I'm using bootstrap tooltip in cycle.js and none of the above worked for me.



                      I had to do this:



                      return button( selector + '.btn.btn-sm', 
                      {
                      hook: {
                      destroy: tooltipOff,
                      insert: toggleTooltipOn,
                      },
                      ....

                      function toggleTooltipOn(vnode){
                      setupJQuery();
                      jQuery[0].$( vnode.elm )
                      .tooltip({container:'body', trigger: 'hover');
                      //container:body is to help tooltips not wiggle on hover
                      //trigger:hover is to only trigger on hover, not on click
                      }

                      function tooltipOff( vnode ){
                      setupJQuery();
                      jQuery[0].$( vnode.elm ).tooltip('hide');
                      }





                      share|improve this answer




























                        0














                        I'm using bootstrap tooltip in cycle.js and none of the above worked for me.



                        I had to do this:



                        return button( selector + '.btn.btn-sm', 
                        {
                        hook: {
                        destroy: tooltipOff,
                        insert: toggleTooltipOn,
                        },
                        ....

                        function toggleTooltipOn(vnode){
                        setupJQuery();
                        jQuery[0].$( vnode.elm )
                        .tooltip({container:'body', trigger: 'hover');
                        //container:body is to help tooltips not wiggle on hover
                        //trigger:hover is to only trigger on hover, not on click
                        }

                        function tooltipOff( vnode ){
                        setupJQuery();
                        jQuery[0].$( vnode.elm ).tooltip('hide');
                        }





                        share|improve this answer


























                          0












                          0








                          0







                          I'm using bootstrap tooltip in cycle.js and none of the above worked for me.



                          I had to do this:



                          return button( selector + '.btn.btn-sm', 
                          {
                          hook: {
                          destroy: tooltipOff,
                          insert: toggleTooltipOn,
                          },
                          ....

                          function toggleTooltipOn(vnode){
                          setupJQuery();
                          jQuery[0].$( vnode.elm )
                          .tooltip({container:'body', trigger: 'hover');
                          //container:body is to help tooltips not wiggle on hover
                          //trigger:hover is to only trigger on hover, not on click
                          }

                          function tooltipOff( vnode ){
                          setupJQuery();
                          jQuery[0].$( vnode.elm ).tooltip('hide');
                          }





                          share|improve this answer













                          I'm using bootstrap tooltip in cycle.js and none of the above worked for me.



                          I had to do this:



                          return button( selector + '.btn.btn-sm', 
                          {
                          hook: {
                          destroy: tooltipOff,
                          insert: toggleTooltipOn,
                          },
                          ....

                          function toggleTooltipOn(vnode){
                          setupJQuery();
                          jQuery[0].$( vnode.elm )
                          .tooltip({container:'body', trigger: 'hover');
                          //container:body is to help tooltips not wiggle on hover
                          //trigger:hover is to only trigger on hover, not on click
                          }

                          function tooltipOff( vnode ){
                          setupJQuery();
                          jQuery[0].$( vnode.elm ).tooltip('hide');
                          }






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 1 '17 at 15:22









                          Brian C.Brian C.

                          2,25811421




                          2,25811421























                              0














                              This works for me :



                              $(document).ready(function() {
                              $('#save').tooltip({
                              trigger : 'hover'
                              }) ;

                              });


                              I was disabling save button dynamically then problem was.






                              share|improve this answer


























                              • Here save is id of my button

                                – Devendra Singraul
                                Nov 8 '17 at 10:58
















                              0














                              This works for me :



                              $(document).ready(function() {
                              $('#save').tooltip({
                              trigger : 'hover'
                              }) ;

                              });


                              I was disabling save button dynamically then problem was.






                              share|improve this answer


























                              • Here save is id of my button

                                – Devendra Singraul
                                Nov 8 '17 at 10:58














                              0












                              0








                              0







                              This works for me :



                              $(document).ready(function() {
                              $('#save').tooltip({
                              trigger : 'hover'
                              }) ;

                              });


                              I was disabling save button dynamically then problem was.






                              share|improve this answer















                              This works for me :



                              $(document).ready(function() {
                              $('#save').tooltip({
                              trigger : 'hover'
                              }) ;

                              });


                              I was disabling save button dynamically then problem was.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Nov 8 '17 at 11:39









                              Alfaplus

                              1,31111425




                              1,31111425










                              answered Nov 8 '17 at 10:58









                              Devendra SingraulDevendra Singraul

                              164112




                              164112













                              • Here save is id of my button

                                – Devendra Singraul
                                Nov 8 '17 at 10:58



















                              • Here save is id of my button

                                – Devendra Singraul
                                Nov 8 '17 at 10:58

















                              Here save is id of my button

                              – Devendra Singraul
                              Nov 8 '17 at 10:58





                              Here save is id of my button

                              – Devendra Singraul
                              Nov 8 '17 at 10:58











                              0














                              The way I fixed this issue was by removing the tooltip in the click event function using the following code:



                              $("#myButton").on("click", function() {
                              $("div[role=tooltip]").remove();
                              });





                              share|improve this answer



















                              • 1





                                can You ble get the tooltip again on hover?

                                – Vishnu
                                Jun 28 '18 at 11:55
















                              0














                              The way I fixed this issue was by removing the tooltip in the click event function using the following code:



                              $("#myButton").on("click", function() {
                              $("div[role=tooltip]").remove();
                              });





                              share|improve this answer



















                              • 1





                                can You ble get the tooltip again on hover?

                                – Vishnu
                                Jun 28 '18 at 11:55














                              0












                              0








                              0







                              The way I fixed this issue was by removing the tooltip in the click event function using the following code:



                              $("#myButton").on("click", function() {
                              $("div[role=tooltip]").remove();
                              });





                              share|improve this answer













                              The way I fixed this issue was by removing the tooltip in the click event function using the following code:



                              $("#myButton").on("click", function() {
                              $("div[role=tooltip]").remove();
                              });






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 14 '18 at 0:25









                              soroxissoroxis

                              5614




                              5614








                              • 1





                                can You ble get the tooltip again on hover?

                                – Vishnu
                                Jun 28 '18 at 11:55














                              • 1





                                can You ble get the tooltip again on hover?

                                – Vishnu
                                Jun 28 '18 at 11:55








                              1




                              1





                              can You ble get the tooltip again on hover?

                              – Vishnu
                              Jun 28 '18 at 11:55





                              can You ble get the tooltip again on hover?

                              – Vishnu
                              Jun 28 '18 at 11:55











                              0















                              Inside your document ready function use this




                               $(document).ready(function(){
                              $('[data-toggle="tooltip"]').tooltip({
                              trigger : 'hover'
                              });
                              });





                              share|improve this answer




























                                0















                                Inside your document ready function use this




                                 $(document).ready(function(){
                                $('[data-toggle="tooltip"]').tooltip({
                                trigger : 'hover'
                                });
                                });





                                share|improve this answer


























                                  0












                                  0








                                  0








                                  Inside your document ready function use this




                                   $(document).ready(function(){
                                  $('[data-toggle="tooltip"]').tooltip({
                                  trigger : 'hover'
                                  });
                                  });





                                  share|improve this answer














                                  Inside your document ready function use this




                                   $(document).ready(function(){
                                  $('[data-toggle="tooltip"]').tooltip({
                                  trigger : 'hover'
                                  });
                                  });






                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Jul 26 '18 at 6:13









                                  Siva GaneshSiva Ganesh

                                  8271416




                                  8271416























                                      0














                                      This solution worked for me.



                                      $('a[data-toggle="tooltip"]').tooltip({
                                      animated: 'fade',
                                      placement: 'bottom',
                                      trigger: 'click'
                                      });

                                      $('a[data-toggle="tooltip"]').click(function(event){
                                      event.stopPropagation();
                                      });

                                      $('body').click(function(){
                                      $('a[data-toggle="tooltip"]').tooltip('hide');
                                      });


                                      fiddle



                                      I tried most of the solutions given in previous answers, but none of them worked for me.






                                      share|improve this answer






























                                        0














                                        This solution worked for me.



                                        $('a[data-toggle="tooltip"]').tooltip({
                                        animated: 'fade',
                                        placement: 'bottom',
                                        trigger: 'click'
                                        });

                                        $('a[data-toggle="tooltip"]').click(function(event){
                                        event.stopPropagation();
                                        });

                                        $('body').click(function(){
                                        $('a[data-toggle="tooltip"]').tooltip('hide');
                                        });


                                        fiddle



                                        I tried most of the solutions given in previous answers, but none of them worked for me.






                                        share|improve this answer




























                                          0












                                          0








                                          0







                                          This solution worked for me.



                                          $('a[data-toggle="tooltip"]').tooltip({
                                          animated: 'fade',
                                          placement: 'bottom',
                                          trigger: 'click'
                                          });

                                          $('a[data-toggle="tooltip"]').click(function(event){
                                          event.stopPropagation();
                                          });

                                          $('body').click(function(){
                                          $('a[data-toggle="tooltip"]').tooltip('hide');
                                          });


                                          fiddle



                                          I tried most of the solutions given in previous answers, but none of them worked for me.






                                          share|improve this answer















                                          This solution worked for me.



                                          $('a[data-toggle="tooltip"]').tooltip({
                                          animated: 'fade',
                                          placement: 'bottom',
                                          trigger: 'click'
                                          });

                                          $('a[data-toggle="tooltip"]').click(function(event){
                                          event.stopPropagation();
                                          });

                                          $('body').click(function(){
                                          $('a[data-toggle="tooltip"]').tooltip('hide');
                                          });


                                          fiddle



                                          I tried most of the solutions given in previous answers, but none of them worked for me.







                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Aug 28 '18 at 6:37









                                          Jean-François Corbett

                                          28.9k22111162




                                          28.9k22111162










                                          answered Aug 28 '18 at 6:16









                                          طلحةطلحة

                                          9617




                                          9617























                                              0














                                              My problem is in DataTable. Below code works for me.




                                              columnDefs: [
                                              {
                                              targets: 0, data: "id",
                                              render: function (data, type, full, meta) {
                                              return '<a href="javascript:;" class="btn btn-xs btn-default" data-toggle="tooltip" title="Pending" data-container="body"><i class="fa fa-check"></i></a>';
                                              }
                                              }
                                              ],
                                              drawCallback: function() {
                                              $('[data-toggle="tooltip"]').tooltip();
                                              $('[data-toggle="tooltip"]').on('click', function () {
                                              $(this).tooltip('hide');
                                              });
                                              }






                                              share|improve this answer




























                                                0














                                                My problem is in DataTable. Below code works for me.




                                                columnDefs: [
                                                {
                                                targets: 0, data: "id",
                                                render: function (data, type, full, meta) {
                                                return '<a href="javascript:;" class="btn btn-xs btn-default" data-toggle="tooltip" title="Pending" data-container="body"><i class="fa fa-check"></i></a>';
                                                }
                                                }
                                                ],
                                                drawCallback: function() {
                                                $('[data-toggle="tooltip"]').tooltip();
                                                $('[data-toggle="tooltip"]').on('click', function () {
                                                $(this).tooltip('hide');
                                                });
                                                }






                                                share|improve this answer


























                                                  0












                                                  0








                                                  0







                                                  My problem is in DataTable. Below code works for me.




                                                  columnDefs: [
                                                  {
                                                  targets: 0, data: "id",
                                                  render: function (data, type, full, meta) {
                                                  return '<a href="javascript:;" class="btn btn-xs btn-default" data-toggle="tooltip" title="Pending" data-container="body"><i class="fa fa-check"></i></a>';
                                                  }
                                                  }
                                                  ],
                                                  drawCallback: function() {
                                                  $('[data-toggle="tooltip"]').tooltip();
                                                  $('[data-toggle="tooltip"]').on('click', function () {
                                                  $(this).tooltip('hide');
                                                  });
                                                  }






                                                  share|improve this answer













                                                  My problem is in DataTable. Below code works for me.




                                                  columnDefs: [
                                                  {
                                                  targets: 0, data: "id",
                                                  render: function (data, type, full, meta) {
                                                  return '<a href="javascript:;" class="btn btn-xs btn-default" data-toggle="tooltip" title="Pending" data-container="body"><i class="fa fa-check"></i></a>';
                                                  }
                                                  }
                                                  ],
                                                  drawCallback: function() {
                                                  $('[data-toggle="tooltip"]').tooltip();
                                                  $('[data-toggle="tooltip"]').on('click', function () {
                                                  $(this).tooltip('hide');
                                                  });
                                                  }







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Nov 28 '18 at 19:58









                                                  WHYWHY

                                                  556




                                                  556























                                                      0














                                                      You can also use below method to hide tooltip on mouseleave, As below:



                                                      jQuery("body").on("mouseleave", ".has-tooltip", function(){
                                                      jQuery(this).blur();
                                                      });





                                                      share|improve this answer






























                                                        0














                                                        You can also use below method to hide tooltip on mouseleave, As below:



                                                        jQuery("body").on("mouseleave", ".has-tooltip", function(){
                                                        jQuery(this).blur();
                                                        });





                                                        share|improve this answer




























                                                          0












                                                          0








                                                          0







                                                          You can also use below method to hide tooltip on mouseleave, As below:



                                                          jQuery("body").on("mouseleave", ".has-tooltip", function(){
                                                          jQuery(this).blur();
                                                          });





                                                          share|improve this answer















                                                          You can also use below method to hide tooltip on mouseleave, As below:



                                                          jQuery("body").on("mouseleave", ".has-tooltip", function(){
                                                          jQuery(this).blur();
                                                          });






                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited Dec 19 '18 at 11:26

























                                                          answered Nov 29 '18 at 8:26









                                                          Hanuman Sahay Hanuman Sahay

                                                          11




                                                          11






























                                                              draft saved

                                                              draft discarded




















































                                                              Thanks for contributing an answer to Stack Overflow!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f33584392%2fbootstraps-tooltip-doesnt-disappear-after-button-click-mouseleave%23new-answer', 'question_page');
                                                              }
                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                                                              Calculate evaluation metrics using cross_val_predict sklearn

                                                              Insert data from modal to MySQL (multiple modal on website)