Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooltip+popover destroy method does not remove the element from the DOM #10740

Closed
fadomire opened this issue Sep 20, 2013 · 11 comments
Closed

tooltip+popover destroy method does not remove the element from the DOM #10740

fadomire opened this issue Sep 20, 2013 · 11 comments

Comments

@fadomire
Copy link

i searched for an already opened issue but did not found any that was reporting this exact problem.

I'm trying to use the destroy method on tooltip (bootstrap v3) but it does not remove the element from the DOM.

Any idea ?

Fiddle : http://jsfiddle.net/52VtD/59/

click on the button to trigger the tooltip destroy method

@Merg1255
Copy link

It's confirmed on FF 24.

@cvrebert
Copy link
Collaborator

Also applies to popovers since they're an extension of tooltips.

fadomire added a commit to fadomire/bootstrap that referenced this issue Sep 23, 2013
… element from the DOM

added a remove() on the tooltip dom element in destroy method
fadomire added a commit to fadomire/bootstrap that referenced this issue Sep 23, 2013
… element from the DOM

tweaked the patch to avoid creating a tooltip if never shown before as @jochenberger suggested
@CrowderSoup
Copy link

The pull request from @jooleeunc should solve this issue, but until it's accepted I needed a workaround. Here it is:

// Fix for bootstrap tooltips, sometimes they are left in the DOM when they shouldn't be.
$('body').on('hidden.bs.tooltip', function() {
    var tooltips = $('.tooltip').not('.in');
    if (tooltips) {
        tooltips.remove();
    }
});

@fat
Copy link
Member

fat commented Dec 24, 2013

this is the official fix for this issue 1fc08c1

@fat fat closed this as completed Dec 24, 2013
@fat
Copy link
Member

fat commented Dec 24, 2013

thanks for reporting! ❤️

@onigetoc
Copy link

i didn't realize that i downloaded the latest version more than 1 month ago

@cvrebert
Copy link
Collaborator

@onigetoc You do have a choice. The bug has been fixed in master. I really don't understand the point of your comment.

@sirNemanjapro
Copy link

Bug is active in 3.1.1.

@cvrebert
Copy link
Collaborator

@sirNemanjapro Please open a new issue that includes a JS Fiddle (or similar) demonstrating that the problem still exists.

@sirNemanjapro
Copy link

@cvrebert I have opened a new issue, but I dont really have an example for you at this point. The problem is active, I changed all the files that could influence the tooltip not to be removed but it still didnt help.

@julianxhokaxhiu
Copy link

I have this example where the tooltip seems not to be destroyed: http://jsfiddle.net/e6247y9c/

What do I have to do to fix this?

//EDIT: probably I found a solution, could it be? http://jsfiddle.net/e6247y9c/2/

@twbs twbs locked and limited conversation to collaborators Aug 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants