Bootstrap: 3.3.7. It is not reproducible with 3.3.6.
Browser/OS: Chrome 51 on Debian Jessie.
Run this jsbin: http://output.jsbin.com/jowiha
For the record, the code essential for reproduction is:
$(function () {
var $tipped = $("#tipped");
$tipped.tooltip({
title: "something",
placement: "auto",
});
$tipped.tooltip("show");
$tipped.tooltip("destroy");
$tipped.tooltip("destroy");
});
The tooltip should be destroyed. No errors. The 2nd destruction should just be a no-op.
The console shows:
Uncaught TypeError: Cannot read property 'off' of null
Popovers are also affected because they share the same code.
This problem was introduced in 3.3.7 with the nullification of the $element
property of the tooltip.
Here is another failure related to the first one, using the same jsbin but replacing these lines:
$tipped.tooltip("show");
$tipped.tooltip("destroy");
$tipped.tooltip("destroy");
with these:
$tipped.tooltip("show");
$tipped.tooltip("destroy");
$tipped.tooltip("show");
I get the error:
bootstrap.js:1491 Uncaught TypeError: Cannot read property 'trigger' of null
The earlier error was happening in the callback passed to this.hide
in the destroy
method. This one happens in the complete
callback that runs once the transition showing the tooltip is over.
In both cases the issue is that code scheduled to run in the future is operating on a tooltip that has been destroyed.
In my case when I got this error, I bound an event listener to "mouseout" on my element after manually showing the tooltip that would call $('selector').tooltip('destroy')
, so after I called the destroy action I unbound my mouseout
listener from my jq element and that fixed the issue for me.
Bootstrap 3 is no longer being officially developed or supported.
All work has moved onto our next major release, v4. As such, this issue or pull request is being closed as a "won't fix." For additional help and support, we recommend utilizing our community resources. Thanks for your understanding, and see you on the other side of v4!
<3,
@mdo and team
So v4 isn't even released as stable yet, and you're closing issues with the latest stable release as wontfix?
@mdo, unfortunately, In "real" production environments, you cannot always "_just upgrade_" to v4... It would be nice if you guys could address this issue. Clearly, you guys do not carry out to, nor care about your Enterprise users...
@stephanepericat I believe this why it's open source and free. If you need something to be fixed, you can create PR and fix it. They don't get paid for things they are doing. If this is critical fix, Enterprise company can contact one of the core developers and pay for those fix.
@artyomtrityak when you release something open source it is your responsibility to maintain it otherwise it's basically unusable and therefore useless. it's fine; we will consider other options...
Thank you for that entitled viewpoint @stephanepericat - how silly of us not to consider our enterprise users and our responsibilities, since we do this in our spare time for no payment or recognition...
Most helpful comment
So v4 isn't even released as stable yet, and you're closing issues with the latest stable release as wontfix?