Modal with table won't trigger actions

I am trying to open a modal via a headerAction on a table that is opened in a modal from withtin a custom livewire component. The Field aanmaken button should open a modal, but does nothing except sending an update request. Also the reorder button doesn't work. Am I doing something wrong, is this even possible?
4 Replies
Kaaiman
KaaimanOP2mo ago
I now see that the record actions also don't work.
final class ManageFields extends Component implements HasActions, HasSchemas, HasTable
{
use InteractsWithActions;
use InteractsWithSchemas;
use InteractsWithTable;

public ?Category $category = null;

public function table(Table $table): Table
{
return $table
->relationship(
relationship: fn () => $this->category->fields()
)
->columns([
TextColumn::make('name'),
])
->headerActions([
CreateAction::make()
->schema(fn (Schema $schema) => $schema
->components([
Hidden::make('category_id')
->dehydrateStateUsing(fn () => $this->category->id),
TextInput::make('name')
->label(__('Name'))
->required()
->maxLength(255),
Select::make('type')
->label(__('Field type'))
->live()
->options(FieldType::class)
->enum(FieldType::class)
->required(),
Repeater::make('options')
->visible(fn (Get $get) => $get('type') === FieldType::Select->value || $get('type') === FieldType::Radio->value)
->label(__('Options'))
->simple(TextInput::make('options')),
])),
])
->defaultSort('sort_order')
->reorderable('sort_order');
}

public function render(): View
{
return view('livewire.weddings.manage-fields');
}
}
final class ManageFields extends Component implements HasActions, HasSchemas, HasTable
{
use InteractsWithActions;
use InteractsWithSchemas;
use InteractsWithTable;

public ?Category $category = null;

public function table(Table $table): Table
{
return $table
->relationship(
relationship: fn () => $this->category->fields()
)
->columns([
TextColumn::make('name'),
])
->headerActions([
CreateAction::make()
->schema(fn (Schema $schema) => $schema
->components([
Hidden::make('category_id')
->dehydrateStateUsing(fn () => $this->category->id),
TextInput::make('name')
->label(__('Name'))
->required()
->maxLength(255),
Select::make('type')
->label(__('Field type'))
->live()
->options(FieldType::class)
->enum(FieldType::class)
->required(),
Repeater::make('options')
->visible(fn (Get $get) => $get('type') === FieldType::Select->value || $get('type') === FieldType::Radio->value)
->label(__('Options'))
->simple(TextInput::make('options')),
])),
])
->defaultSort('sort_order')
->reorderable('sort_order');
}

public function render(): View
{
return view('livewire.weddings.manage-fields');
}
}
Kenneth Sese
Kenneth Sese2mo ago
@Kaaiman There’s a GitHub issue open around this topic: https://github.com/filamentphp/filament/issues/16549
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...
David | Fortune Validator
did you get any fix for this? I use modalContent with filament tables in quite a few places same issue. actions dont trigger
Dhru
Dhru2mo ago
I posted a quick workaround here but yea some sort of bug I think @David | Fortune Validator https://discord.com/channels/883083792112300104/1394288676334207016

Did you find this page helpful?