v4 Rendering Relation Manager in a Modal not working

Previously, in v3 I was able to render a relation manager using this:
->modalContent(function (InventoryItem $record) {
return ViewField::make('unitConversionRelationManager')
->view('filament-panels::components.resources.relation-managers')
->viewData([
'managers' => [UnitConversionsRelationManager::class],
'ownerRecord' => $record,
'activeManager' => '0',
'pageClass' => static::class,
])->render();
});
->modalContent(function (InventoryItem $record) {
return ViewField::make('unitConversionRelationManager')
->view('filament-panels::components.resources.relation-managers')
->viewData([
'managers' => [UnitConversionsRelationManager::class],
'ownerRecord' => $record,
'activeManager' => '0',
'pageClass' => static::class,
])->render();
});
I've updated my modal content to something like this in v4 (I lifted the Livewire::make from the HasRelationManagers getRelationManagersContentComponent method), I can get the table to render, but it does not respond to any clicks:
->modalContent(function (CustomForm $record, Schema $schema) {
// Calendar availability relation manager
return Livewire::make(CalendarFieldOptionsRelationManager::class, [
'ownerRecord' => $record,
'pageClass' => static::class,
])->key(CalendarFieldOptionsRelationManager::class)
->container($schema)
->render();
});
->modalContent(function (CustomForm $record, Schema $schema) {
// Calendar availability relation manager
return Livewire::make(CalendarFieldOptionsRelationManager::class, [
'ownerRecord' => $record,
'pageClass' => static::class,
])->key(CalendarFieldOptionsRelationManager::class)
->container($schema)
->render();
});
Is this the proper way to approach this requirement in v4? If this is just a bug then I can dive further and open up a new issue on Github
2 Replies
awcodes
awcodes2mo ago
GitHub
v4: actions in modal actions with livewire component not working ·...
Package filament/filament Package Version v4.0.0-beta5 Laravel Version v12.18.0 Livewire Version v3.6.3 PHP Version PHP8.2+ Breaking change description Filament actions have a modalContent option w...
mrkbingham
mrkbinghamOP2mo ago
Ah, I wasn't sure if this was the same issue, thanks for confirming @awcodes ! 👍

Did you find this page helpful?