Hidden Action and action modal not opening. But if remove hidden the modal works

If i have a table and in the table i have actions that are hidden/visible based on some criteria. and the action is supposed to open a modal with a form, it's not opening the modal. I can see the request to the server to "open" modal but the modal does not open. If I remove the 'hidden" or 'visible' methods from the action, then the modal opens without a problem.

This code does NOT open modal
Tables\Actions\Action::make('uploadCover')
                ->icon('iconoir-media-image-plus')
                ->hidden(fn ($record): bool => !$record->canAction($user, 'release_upload_cover'))
                ->form([
                    Forms\Components\FileUpload::make('cover')
                            ->label('Cover')
                            ->image()
                            ->directory('covers')
                ])
                ->action(function (array $data, Model $record): void {
                    dd($data, $record);
                })



This code WORKS as expected
Tables\Actions\Action::make('uploadCover')
                ->icon('iconoir-media-image-plus')
                ->form([
                    Forms\Components\FileUpload::make('cover')
                            ->label('Cover')
                            ->image()
                            ->directory('covers')
                ])
                ->action(function (array $data, Model $record): void {
                    dd($data, $record);
                })


Please help. Thanks
Was this page helpful?