Builder reactivity broken when using previews
Package
filament/filament
Package Version
v3.2.99
Laravel Version
v11.20.0
Livewire Version
No response
PHP Version
PHP 8.2
Problem description
When using the blockPreviews for Builder the reactivity in the modal form doesn't work once the block is saved.
https://github.com/user-attachments/assets/0fb1a824-7025-4f7e-937e-9d1523ea96d1
Expected behavior
Same as without blockPreviews
Steps to reproduce
See https://github.com/martin-ro/block-builder (UserResource)
or
add this to a from:
Forms\Components\Builder::make('blocks')
->blockPreviews()
->schema([
Forms\Components\Builder\Block::make('test')
->preview('components.test')
->schema([
Forms\Components\Checkbox::make('is_company')
->live(),
Forms\Components\TextInput::make('company_name')
->hidden(fn(Forms\Get $get): bool => !$get('is_company'))
])
])
Reproduction repository (issue will be closed if this is not valid)
https://github.com/martin-ro/block-builder
Relevant log output
No response
Donate 💰 to fund this issue
- You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
- 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
- Thank you in advance for helping us make maintenance sustainable!
Another observation I just made is that wrapping components in for example a group or fieldset reactivity works inside it. So this is only broken for "top level" components.
@danharrin this seems to be already fixed, at least in the latest version [v3.2.136]
https://youtu.be/SNWtRdyG2Sg
Additionally, the given repository does not exist. regards
@martin-ro can you confirm please?
@martin-ro can you confirm please?
Yes @danharrin, the issue persists. The yt video @borjajimnz posted never saved the model so it appears it is working.
Steps to reproduce:
- Add
Testblock - Check checkbox
- Enter name
- Save block
- Save record
Reactivity works so far
- Uncheck checkbox
- Save block
- Save record
Now reactivity is broken, you can not get the TextInput to be shown anymore.
I pushed another repo here: https://github.com/martin-ro/filament-reactivity/
On the UserResource there is a commented second example that works because the fields in the block are wrapped in a group.
Yes, @martin-ro, I can reproduce this now. I'll give it a shot. Thanks!