Question about Accordion Cards…
How can I make an Icon change his class (“bi-caret-down-square-fill”) in section “card-header”, only when “#accordion1” is open?
Accordions have a default icon, which animates as per state of the collapse in it.
There are no Wappler show/hide events for accordion, like there is for regular dynamic collapse.
You can use JS if you wish to do something on accordion collapse’s show/hide events. Bind the click event to call a JS function, determine the state of collapse and do what is needed there.
I just remembered, @markoax21, the above code from @ben could work if you add is="dmx-bs5-collapse" attribute manually to the collapse in your code (which Ben’s collapse already has).
Its not added by default to the accordion added by Wappler UI.
Weird. I was using this just a few days ago, when I had this issue of is attribute missing. Maybe I copied the accordion code it from BS5 website and not added from Wappler.
I tried just now, and it works as you have suggested.
@markoax21 I see that your sample code is missing this attribute… could be that you added it manually as well?