-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Already Visible collapse gets closed when .collapse('show') is called #14282
Comments
Can you please confirm that you're seeing this with Bootstrap v3.2.0? |
Also, please post a JS Bin or similar demonstrating the problem. |
I am using Bootstrap v3.2.0. I will post a JS Bin etc when I have a little more time later today or tomorrow. |
This happens for me only once when you call it the first time. It's because (for some reason) the Anyway, a immediate solution to your problem could also be: $.fn.collapse.Constructor.DEFAULTS.toggle = false; /cc @fat PS: Sorry for the wall of text. |
That is exactly what was happening for me; only the first time. |
I see. Why close this issue though? |
Oh well I was just going to use your suggested quick-fix. But I'll reopen so everyone knows it is not properly solved. |
Yeah, I'd like to see this fixed by either of the two approaches I suggested above. |
The same issue applies when you have a hidden collapse and you apply .collapse('hide') the first time. |
I can confirm this issue (happening both on 'show' and 'hide'). I could swear that this just started to happen all of a sudden: one day it wasn't happening, the next one, the issue was there. Once of those things that I cannot begin to explain... In the middle, I upgraded to v3.2.0, but then I just reverted to see if it happened on v3.1.1, and it did too. |
setting the default to false is not really a great solution… i think when most people call .collapse() they want it to collapse. we could definitely be smarter about it |
Yeah, but in this case |
fixes #14282 - Already Visible collapse gets closed when …
I have this behavior with 3.3.1 This fiddle tries to show a collapse but all get opened Manually disabling $('.collapse').collapse({'toggle': false}) But this workaround (suggested in old #5859) does not work programmatically with 3.2.0, seeming like a race condition here. Is there an explanation somewhere of why this |
Hi @Glideh! You appear to have posted a live example (http://s.bootply.com/render/3dBY2KSn8y), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
…ixes #15315 Thanks to @peterblazejewicz & @Nikita240 Adds unit tests based on #14417 X-Ref: #14282 Closes #15807
…ixes #15315 Thanks to @peterblazejewicz & @Nikita240 Adds unit tests based on #14417 X-Ref: #14282 Closes #15807
I have a panel-collapse in a dropdown menu that I want to to open up if the panel contains a link with the ".active" css class. To make this work I close all collapses and then open up the one I want to open when the dropdown is hidden (note, all of the collapses start open by default):
However this doesn't work. The .collapse('show') is actually closing the open panel for some reason. However if I use more specific css and don't explicitly show the panel I want to have open unless it is closed, it works:
The text was updated successfully, but these errors were encountered: