{"action":"created","issue":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/3084","labels_url":"https://api.github.com/repos/twbs/bootstrap/issues/3084/labels{/name}","comments_url":"https://api.github.com/repos/twbs/bootstrap/issues/3084/comments","events_url":"https://api.github.com/repos/twbs/bootstrap/issues/3084/events","html_url":"https://github.com/twbs/bootstrap/issues/3084","id":4131096,"number":3084,"title":"Tooltip doesn't hide when parent element removed","user":{"login":"OndraM","id":793041,"avatar_url":"https://avatars.githubusercontent.com/u/793041?v=3","gravatar_id":"","url":"https://api.github.com/users/OndraM","html_url":"https://github.com/OndraM","followers_url":"https://api.github.com/users/OndraM/followers","following_url":"https://api.github.com/users/OndraM/following{/other_user}","gists_url":"https://api.github.com/users/OndraM/gists{/gist_id}","starred_url":"https://api.github.com/users/OndraM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndraM/subscriptions","organizations_url":"https://api.github.com/users/OndraM/orgs","repos_url":"https://api.github.com/users/OndraM/repos","events_url":"https://api.github.com/users/OndraM/events{/privacy}","received_events_url":"https://api.github.com/users/OndraM/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/twbs/bootstrap/labels/js","name":"js","color":"ffc40d"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2012-04-16T09:17:27Z","updated_at":"2015-07-20T20:00:07Z","closed_at":"2012-04-18T20:21:04Z","body":"I use Tooltip on buttons initiating AJAX loads, which remove the content including the tooltip parent element. In that case the tooltip won't hide.\r\n\r\nSteps to reproduce:\r\n1) Mouseover the button with tooltip\r\n2) Tooltip is shown\r\n3) Click the button (while the tooltip is shown)\r\n4) The element where the tooltip parent element was placed is now removed/replaced with AJAX\r\n5) New content is displayed, but the tooltip is still present, and I am unable to remove it (the mouseleave event won't fire, because the tooltip parent element is no longer there).\r\n\r\nI created JS fiddle demonstrating the issue: http://jsfiddle.net/fjHh5/"},"comment":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/comments/123010967","html_url":"https://github.com/twbs/bootstrap/issues/3084#issuecomment-123010967","issue_url":"https://api.github.com/repos/twbs/bootstrap/issues/3084","id":123010967,"user":{"login":"Joyrex","id":651646,"avatar_url":"https://avatars.githubusercontent.com/u/651646?v=3","gravatar_id":"","url":"https://api.github.com/users/Joyrex","html_url":"https://github.com/Joyrex","followers_url":"https://api.github.com/users/Joyrex/followers","following_url":"https://api.github.com/users/Joyrex/following{/other_user}","gists_url":"https://api.github.com/users/Joyrex/gists{/gist_id}","starred_url":"https://api.github.com/users/Joyrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joyrex/subscriptions","organizations_url":"https://api.github.com/users/Joyrex/orgs","repos_url":"https://api.github.com/users/Joyrex/repos","events_url":"https://api.github.com/users/Joyrex/events{/privacy}","received_events_url":"https://api.github.com/users/Joyrex/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T20:00:07Z","updated_at":"2015-07-20T20:00:07Z","body":"Just to build on @ElinaldoNascimento's solution listed above - if you hide the tooltip, it simply is hidden, not removed. This method worked better for me and doesn't leave hidden tooltips lying about in your source code:\r\n\r\n$('.tooltip').tooltip('destroy');\r\n\r\nAgain, it's important to call this BEFORE your code that removes the tooltip's parent element. So for example:\r\n\r\n$(#container).fadeOut(600,function(){$('.tooltip').tooltip('destroy');$(#container).remove();});\r\n\r\nHope this helps anyone else that comes across this so when they eventually run into the conclusion that this will not be addressed in the Bootstrap code, they at least won't struggle as much for a solution."}}