-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
class="active" managed improperly with data-toggle="tab" #19374
Comments
@tomkel Please make your example into a JS Bin or JS Fiddle. |
here are the v4 jsfiddles: |
Hi @tomkel! You appear to have posted a live example (http://jsbin.com/fabijusugu/edit), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Hi @tomkel! You appear to have posted a live example (http://jsbin.com/fixiyinuwi/edit), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
The bug persists when setting |
I'm having this issue as well, although whatever I do, it does not work.
|
@cvrebert Any idea when this will be fixed? Thanks. |
@cvrebert Here is an updated JSBin using the latest v4-dev: http://jsbin.com/jinimoqoyo/1/edit?html,output Also, could you please remove the |
Hi @RyanZim! You appear to have posted a live example (http://jsbin.com/hedehalopa/1/edit), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Updated JSBin: http://jsbin.com/jinimoqoyo/1/edit?html,output |
This still happens, and it's tied with issue #18566 |
@cvrebert ping? |
Sorry folks, I was reading an (still) out of date documentation on mdb (materia design bootstrap) that didn't match v4 and triggered this particular behaviour along with the .active class issue. |
I have got the same problem as @tomkel and @chris13524 mentioned. I use this in Bootstrap 3, simple and clean:
Things have changed in Bootstrap 4. The above example
The issue is mentioned also here #20523. |
I have been using this as a workaround for now:
|
Dupe of #18566. |
I got around this by using onMouseUp instead of onClick because the active class is set on MouseDown. So using MouseUp means that my code won't execute until after the active class is set. |
FWIW, this breaks it for keyboard users |
in my case the problem was the bootstrap version, I was using version 4.0.0-alpha.6 and I was using a method from an old version
final structure in my case
|
If you are using Bootstrap 3.3.7 then you can write below custom JQuery to fix this bug.
|
@jaylahoti I tried this and it seems to disable the tabs working at all. |
fixed my issue through remove bt functionality with little custom code #containerContainingTabs is the id on div which container tabs links |
Thank you so much fayazrehmani for this code...Its really work for me. I'm stuck before a 6h ago but you really solved my problem to give me this code. |
Thank you @fayazrehmani this work for me. |
$('.navbar-nav .nav-link').click(function(){ |
@PORRIS :sir but in my case whole page is redirected after click any tab can you tell me what the problem and i am angular9? |
You need to use
|
and really, for in-page controls, you should be using |
This problem still exists in Bootstrap 4.5.3... The 'active' class is not removed from default tab when switching between tabs. |
can i suggest making a fresh issue, with a fresh codepen/jsbin example? |
I would normally but there are countless issues of the same problem on here spanning a number of years and it still hasn't been addressed despite all with activity and closed as duplicates etc. If I find the time at some point, I'll try and raise a new issue 👍 |
2021 and still an issue LOL, i have multiple tab controls in the page, so this worked for me:
|
Here is a working example with a fix. Below is the fix. If you comment out that part, you can still see it is not fixed for 5.0.0-beta2
|
This works:
However when the
<ul>
is changed to a<div>
, the active classes are never unset, thus breaking the data-toggle.This does not work:
The text was updated successfully, but these errors were encountered: