I have a single accordion card I’d like open by default. IS there a way to set that?
On the Card you wish to have open, select the Collapse control from the App Structure
then select the Show checkbox on the Collapse Propertied panel.
To add to what Lee has said, you will also need to add a class of ‘show’ to the relevant collapse region, as in
Thanks Ben, that did it!
Just between you and me, I think that the ‘show’ checkbox is supposed to add the ‘show’ class rather than insert 'show=“true” ’ which does nothing.
Yes, the show checkbox is very confusing
Actually there is a very good reason for the ‘show’ toggle to be an attribute.
This is because we have a special App Connect component for collapse and it works with attributes as well, not only classes. The component allows us to hook the bootstrap events and pass them to app connect so you can add more dynamic functionality on collapse/expand
But the question comes down to how did you define the collapse? If it has the attribute
is="dmx-bs4-collapse" then it is the App Connect component (which is default when you insert it through the UI) and then the show attribute should work.
If it is just a regular Bootstrap 4 collapse (just has the ‘collapse’ class on it not an ‘is’ attribute) then only the ‘show’ class will work.
Anyway to make difference of those two components, I think we will just implement them both separately as regular collapse and dynamic collapse and not as a single one like now. And you will be able to convert from static to dynamic so no breaking changes.
Added the card through the UI. Checking or unchecking the ‘Show’ box made no difference.
This was improved in Wappler 1.9.7