bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

The parent option of Collapse does not work without ".accordion-group" css class

Open soundTricker opened this issue 14 years ago • 12 comments

The parent option of Collapse does not work without .accordion-group css class

Here the jsfiddle. http://jsfiddle.net/AFPE2/1/

I guess the collapse module should not have dependency with .accordion-group css class. but the collapse code has it on here;

Maybe it should be like below.

Now:

actives = this.$parent && this.$parent.find('> .accordion-group > .in')

Maybe should be...

actives = this.$parent && this.$parent.find('> .collapse.in')

but sorry, I have not tested its code.

If I have a time, I'll send pull-request.

soundTricker avatar Sep 05 '12 13:09 soundTricker

Ran into the same issue today.

@soundTricker: Thanks for your fix. Works for me!

holgua avatar Sep 26 '12 13:09 holgua

@holgua Thanks :) But sorry, I couldn't send pull request....

soundTricker avatar Sep 27 '12 06:09 soundTricker

Still having this issue when downloading from the repo

veganista avatar Oct 25 '12 16:10 veganista

Would it not be better to add a css class for collapsing non accordion groups? This would make my life a lot easier and take away the use of added js.

ShaneSheppard avatar Jan 31 '13 16:01 ShaneSheppard

parent is for accordions only

fat avatar Feb 08 '13 05:02 fat

The usage notes specifically say: To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

In other words ... it's NOT for accordions only, it is a method of bringing "accordion-LIKE" group management to other non-accordion elements and, according to the usage notes, should be available without using the full accordion markup.

As this issue IS an issue and has not been resolved it should not have been closed!

philiposborne avatar May 29 '13 14:05 philiposborne

Agreed. Why is this closed? At the least the documentation should be updated to note that the accordion group class is required. As it stands it is completely unclear which classes are required and which are optional. This has not been resolved at all.

Happy to pull request the above fix if it will help. Patched it in to my branch and everything looks good.

kav avatar Jul 03 '13 18:07 kav

+1, this is really annoying and lost several hours searching for the answer. Should not be closed, needs a fix.

davekiss avatar Jul 05 '13 16:07 davekiss

Your fix for the bootstrap.js worked for me.

axiomaximum avatar Aug 06 '13 18:08 axiomaximum

+1, it should be fixed

+1. Ran into this issue today. Why is this restricted to .panel here ?

https://github.com/twbs/bootstrap/blob/master/js/collapse.js#L51

selvagsz avatar Oct 22 '13 17:10 selvagsz

Pull request that solves this problem: #10966

raeno avatar Oct 23 '13 14:10 raeno