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

Two or more panels can be opened in an accordion at one time by clicking the links before animation completes. #13447

Closed
u353 opened this issue Apr 26, 2014 · 4 comments · Fixed by #14353

Comments

@u353
Copy link

u353 commented Apr 26, 2014

Step 1. Navigate to this page: http://getbootstrap.com/javascript/#collapse
Step 2. Click on one of the links that trigger opening of the accordion sections (ie. Collapsible Group Item #1)
Step 3. Before the section's opening animation has a chance to complete (the one from 'Step 2' above) click on a different link to trigger opening a second panel (ie. Collapsible Group Item #2)

At this point you should see that you have two accordion panels open at the same time.

@cvrebert cvrebert added the js label Apr 26, 2014
@NickColley
Copy link
Contributor

Had a look at this, an easy way to reproduce this this is to press #3 then #2.

I've put together a jsfiddle to test it, one way to fix this is to add collapsing panels to the list of active panels to hide.
However it means it means when you hit the second after it'll prevent it from opening, so it'd probably be better to queue the hide.

Check out the addition on line 43
http://jsfiddle.net/QdPBw/1/

@cvrebert cvrebert added this to the v3.2.0 milestone Apr 26, 2014
@Jakobovski
Copy link

@NickColley

Nice!

In addition to your changes you could remove line 85 and line 47(of your code) and unbind the transition end. I am not sure if this is a good idea because I don't fully understand for what scenarios lines 87 and 47 exist. The advantage of this solution is that it will produce a nicer UX than a queue solution.

See http://jsfiddle.net/QdPBw/20/ for a working example.

@u353
Copy link
Author

u353 commented May 1, 2014

Wow, nice. I am just happy that someone else took up issue with this as even I have to admit it is not a show stopper / is mostly for aesthetic reasons that I chose to bring it up.

Great work! I will give props to you when this comes up.

peace,
u35

P.S. sweet avatar nick.

@tobohr
Copy link

tobohr commented Aug 7, 2014

Temporary fix

$(".panel-group").children().click(function (e) {
    if ($(e.currentTarget).siblings().children(".collapsing").length > 0 ) {
        return false;
    }
})

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

Successfully merging a pull request may close this issue.

5 participants