Bootstrap: Tooltip doesn't hide when parent element removed

Created on 20 Mar 2014  路  15Comments  路  Source: twbs/bootstrap

As mentioned before, the problem with the tooltip is active again in 3.1.1.

DEMO >> http://jsfiddle.net/m9AX5/5/

All 15 comments

As mentioned before, duplicate of #3084, which was closed as CANTFIX/WONTFIX and which states what the workaround is.
Exact duplicate of #13130.

Well, someone should fix it. @cvrebert

@fat Is this fixable?

I'm not @fat, but you simply can't. jQuery doesn't provide a way to detect when elements are removed from the DOM. That said, I don't understand why it is so hard to do this.

Also, this only happens when using container: 'body'. Contrast: http://jsfiddle.net/BbJSJ/1/

@cvrebert Please change status of this issue to OPEN.

Solutions presented by @hnrch02 and @cvrebert are working as a hack, but I am a firm believer that we shouldn't use hacks to make something so obvious to work.

Also, solution presented, has a flaw. Once you click on the button, to remove the row, the tooltip flickers for a second before being removed.

btw.
I have to use container: body since its messing up the DOM when there is no body flag in jQuery.

That isn't a hack; did you read what I previously stated? jQuery does not fire an event when an element is removed from the DOM鈥攖here is no way for us to detect removal without patching jQuery, which I would consider a hack and definitely not something appropriate for Bootstrap.

@hnrch02 I thought http://api.jquery.com/on/ was used for those kind of things.

$.fn.on is used for binding handler functions to events, but there is no point in listening for an event which is never fired.

@hnrch02 I'm sorry I might not completely understand this, but have you even looked at the example? In example, a .on was used for .click after which the element was .remove from DOM.

I am now ignoring this thread due to the lack of cluefulness that is on display.
@sirNemanjapro Do you comprehend the meaning of "CANTFIX"?

@cvrebert Please do ignore this and any other bug related issue concerning any of the projects here at github. I do believe that would be in the best interest of everyone. Marking the issue closed, since its obvious a lot of people are having a problem with this is counter productive, to say the least.

I suggest that a unified method and/or case is created in Bootstrap for the specific occasion when the tooltip is used on elements that can/could be removed. I don't think that would create a too much of a load on Bootstrap's resources, and it would help developers having a quality framework.

You obviously can not propose a solution to this problem yourself, still you demand that "somebody" should fix it already鈥攅ven after someone took the time and presented a perfectly good solution to your problem. This is ridiculous and not worth anybody's time, especially not the maintainers'.

@hnrch02 Excuse me for being busy at work and not having time to fix that what someone else created and labeled it "deal with it", but rather presenting a possible method of solution.

"Solution" presented here is not really a solution, its more of a hack used on case per case basis.

There are lots of "possible methods of solution" for all kinds of problems, but those methods don't help much. Code or it doesn't exist.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IamManchanda picture IamManchanda  路  3Comments

devfrey picture devfrey  路  3Comments

kamov picture kamov  路  3Comments

cvrebert picture cvrebert  路  3Comments

bellwood picture bellwood  路  3Comments