remove tab
Created by: lionncle
when a tab is dynamically removed a error occur : TypeError: e is undefined (tab.js:152:12) my code:
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link" id="firstTab-nav" data-toggle="tab" href="#firstTab" role="tab" >First tab</a>
<a class="nav-item nav-link" id="secondTab-nav" data-toggle="tab" href="#secondTab">Second tab</a>
<a class="nav-item nav-link" id="thirdTab-nav" data-toggle="tab" href="#thirdTab">Third tab<span class="close ml-1">×</span></a>
</div>
$(".nav-tabs").on("click", "span", function() {
var tab = $(this).parent();
// $(tab.attr("href")).remove();
// $("#firstTab").tab('show');
tab.tab('dispose');
tab.remove();
});
In your documentation, you explain that option .tab('dispose') destroy element's tab but this not working.