-
-
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
Collapse initial state problem #12254
Comments
Confirmed in current |
So, my current hypothesis is that this is due to the Collapse constructor defaulting its |
Collapsed class doesn't get applied initially. Only on user action with accordion is it properly added to all accordion elements that start out collapsed http://screencast.com/t/eXYKeokJYIGT This makes is difficult theming say a up/down arrow on the element. |
@Soundvessel what happens if you add the On Fri, Jan 17, 2014 at 5:40 PM, Soundvessel [email protected]:
|
I have tried many combinations to get the expected behaviour, but none of them worked ( The closest solution I have is to have a .collapse, and to show it in js on load, but then the opening animation runs onload, which I'd rather not. If anyone has a hacky solution to get around this before bugfix, it would be very appreciated. Thanks. |
I use .collapse and then in javascript: el.collapse({toggle: false}); |
Thanks @nanotronic. Indeed it seems that
Initializes the js states as expected. This fiddle implements it : http://jsfiddle.net/cH6q6/ |
so… close issue? |
Punting to v4. |
@aug-riedinger Are you in fact asking about the bootstrap 2.3.2 Collapse because I'm not sure which collapse your are using in your Fiddle. For me leaving out the 'collapse' class from the accordion-body is working. In fact I leave out all the classnames like 'in' and 'collapsed' which are added automatically by the initialization (.collapse()) or when the accordion is actually being used. Of course you still need the data-attributes for the accordion-toggle. |
I've read couple of problems concerning the collapse initial state, but none exactly reproduces and offers a solution to my issue.
This fiddle clearly describes the problem: http://jsfiddle.net/MC8wL/
I have
.block1 .collapse .in
and.block2 .collapse
.If with js, I call the
.block1
to show, it actually collapses the first time. Then the programmatically stored state works and it goes well.In the example, click Show 1 button, and the opposite behaviour as expected will happen.
How can I avoid this to occur? Am I wrongly initializing the state?
Thanks for the help!
The text was updated successfully, but these errors were encountered: