Section with reactive fields forces collapse after field value changes.
I have a use case where I would want the heading of Section to reflect values of fields under it. This is so I can use Section as collapsed by default to save screen space.
The issue is that with this setup:
Auto collapse is forced after each state update.
Here is a video https://www.loom.com/share/9559899844ed4e3480d7af0cb7add516
Any ideas how I could resolve this?
6 Replies
Looks like ->description() has no issues with this. I will be using that for now. Still interested on what coould cause this issue with the heading
What happens when you use ->live() instead of ->reactive() ?
Same thing happns with ->live() or ->lazy()
try to add the code to
->heading()
oh forgot to mention this, but I tried it on heading() instead of make, same result
You need to do a check inside ->collapsed() what is happening is that ->live() causes a refresh of the component that you have told to be collapsed. So when it rerenders it will always be collapsed.