It'd be nice if we had the option to make other accordion sections close upon clicking a new one, similar to the functionality of the accordion sections on this page:

https://www.bsc.coop/index.php/current-members/new-member-info/2012-10-3...

As it is currently, you have to close each manually, and it makes for lots of scrolling if your accordion sections have long content.

Comments

Spokenbird created an issue. See original summary.

thejimbirch’s picture

I think that should be the default way as that is the example in the Bootstrap docs.

https://getbootstrap.com/docs/3.3/javascript/#collapse

I believe our JavaScript is altering it from working that way. We should adjust.

.collapse hides content
.collapsing is applied during transitions
.collapse.in shows content
kwhite’s picture

Assigned: Unassigned » kwhite
kwhite’s picture

StatusFileSize
new1.64 KB

Okay! So the issues were caused by Bootstrap's expectations around markup for the accordion parent container coupled with a missing hash on an ID. This is working for me locally; see what you think.

kwhite’s picture

Status: Active » Needs review

(oops, wrong comment ID in the patch name...)

thejimbirch’s picture

Issue tags: +Seattle2019

  • thejimbirch committed bc43d5c on 8.x-2.x authored by kwhite
    Issue #3016522 by kwhite: Accordion - Add ability to close other...
thejimbirch’s picture

Assigned: kwhite » Unassigned
Status: Needs review » Fixed

Thanks! Fixed in Dev. This patch fixes the Accordion in Bootstrap 4 also! Woo!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

antonio.lepore’s picture

StatusFileSize
new1.93 KB

It's not working for me. According to the latest version of Bootstrap 4 the data-parent attribute is needed on the collapse element, not on the anchor

avpaderno’s picture

@antonio.lepore This issue has been closed two years ago. If there is still something to fix, it's better to open a new issue.