bootstrap-responsive-tabs icon indicating copy to clipboard operation
bootstrap-responsive-tabs copied to clipboard

Collapse toggling bug

Open NeilJS opened this issue 9 years ago • 9 comments

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

NeilJS avatar Nov 05 '15 10:11 NeilJS

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

cbier avatar Dec 13 '15 05:12 cbier

+1

dandiaczun avatar Dec 16 '15 00:12 dandiaczun

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.

https://github.com/twbs/bootstrap/issues/16360 https://github.com/twbs/bootstrap/issues/8400

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

cbier avatar Dec 18 '15 20:12 cbier

I have the same problem

sky93 avatar Feb 10 '16 20:02 sky93

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');
});

mhascak avatar Feb 18 '16 10:02 mhascak

Same issue here. +1

Klainer's workaround is ok.

netAction avatar May 19 '16 16:05 netAction

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.

equiman avatar Jun 06 '16 22:06 equiman

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

ACPrice avatar Jun 20 '17 21:06 ACPrice

Is there any updated fix for this issue..!

Nepal99 avatar Mar 26 '18 15:03 Nepal99