Custom widget collapsible section does not work
I'm building a custom widget to display in a form header, and I'm using the
x-filament::section
helper from the core documentation (https://filamentphp.com/docs/3.x/support/blade-components/section), and the collapsible
flag does not seem to work, I get the following AlpineJS error :
Alpine Expression Error: isCollapsed is not defined Expression: "{ 'invisible h-0 border-none': isCollapsed }"Here is my code, I didn't do anything too fancy yet : When I check the HTML code, the
x-data
directive is present on the section root element with the boolean in it, I don't know what went wrong
Everything is up to date on Composer and NPM (did the v3 upgrade earlier today)7 Replies
FWIW, if I put another section (collapsible) in the content, the child collapse works but not the parent
This broke for me in one of the last couple of releases too. The collapse/expand button reacts to the actions but the content area just remains open or closed depending on the default state.
If it's a definite bug, please raise a github issue.
Turns out I can replicate this in one of my apps.
Seems to be a LW3/Alpine issue. I've found a workaround, which I've PR'ed on Filament. Don't know if Dan will merge it, or has a better solution. I'll let you know what happens.
I need a fix for this for my Maps plugin widget.
Yup, that's the exact behavior I found as well. Hopefully the PR will get merged.
Can you link the PR please ? I can upvote it
@3rgo the PR got merged and included in today's version update, so a composer update should resolve it for you.
Thanks for the heads I'll try it ASAP
Note that I think there may still be issues with 'collapsed' attribute (start collapsed), although 'collapsible' itself is now working. The fix I pR'ed really is just a temporary hack to work round what definitely seems to be a bug in LW3/Alpine.