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

Collapse toggling bug #45

Open
NeilJS opened this issue Nov 5, 2015 · 9 comments
Open

Collapse toggling bug #45

NeilJS opened this issue Nov 5, 2015 · 9 comments
Labels

Comments

@NeilJS
Copy link

NeilJS commented Nov 5, 2015

Hi.
This buggy behaviour applies to this demo page also, so to reproduce...

Clicking between the last two accordion links (Key Features and Source) will show correct collapse/expand toggle behaviour, but if you then click back to the first (How To), you will notice that the last one (Source) is still open, it has not collapsed.

If you play around with it you will notice this happens a lot (eg click first, then second, then back to first: second is still open).

NOTE: if you remove the .active classes from the markup, the problem is gone. You can then use:

$('#myTab a:first').tab('show'); // Select first tab

to show the first panel BUT this only works with the normal, bootstrap/desktop panel, it doesn't also trigger the first responsive accordion (should do).

PS, it would be good to have auto collapse/expand as an option. I would prefer to not use it as it causes unexpected page jumps during collapse when you use more realistic amounts of text in the panels.

Thanks

@cbier
Copy link

cbier commented Dec 13, 2015

This is true! I am having this problem as well. I am surprised that this has slipped by the wayside.

@dandiaczun
Copy link

+1

@cbier
Copy link

cbier commented Dec 18, 2015

When this script calls collapse('show') on the item that has an active class, twitter bootstrap doesn't read the data-parent attribute from the html that was just made.

twbs/bootstrap#16360
twbs/bootstrap#8400

It looks like an object that specifies the parent has to be passed through with this call.. I am looking into this now.

@openam openam added the bug label Jan 3, 2016
@sky93
Copy link

sky93 commented Feb 10, 2016

I have the same problem

@mhascak
Copy link

mhascak commented Feb 18, 2016

I solve this bug by this code:

$('.panel-collapse').on('show.bs.collapse', function (e) {
          $(e.target).closest('.panel').siblings().find('.panel-collapse').collapse('hide');
});

@netAction
Copy link

Same issue here. +1

Klainer's workaround is ok.

@equiman
Copy link

equiman commented Jun 6, 2016

I try fix it with @Klainer and I clicked other tab the tab, but they collapse all the tab and don't show clicked tab.

I'll try to debug it, but it's making some kind of endless loop.

@ACPrice
Copy link

ACPrice commented Jun 20, 2017

Same issue here, and trying Klainer's fix gave me the infinite loop mentioned by equiman

@Nepal99
Copy link

Nepal99 commented Mar 26, 2018

Is there any updated fix for this issue..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants