How to close an ActionGroup dropdown with a custom action function

Is it possible to close the dropdown generated by an ActionGroup, when a custom function is called?

Currently the dropdown will stay open after clicking on the action. I'm sure I'm missing something simple.

Sample ViewRecord page below.

class ViewPost extends ViewRecord
{
    protected static string $resource = PostResource::class;
    
    protected function getActions(): array
    {
        return [
            Actions\ActionGroup::make([
                Actions\Action::make('publish-post')
                    ->label('Publish blog post')
                    ->action('publishPost'),
                // other items ...
            ]),
        ];
    }
    
    public function publishPost()
    {
        $this->record->publish();

        // hide the dropdown
    }
}


Any help is much appreciated!
Was this page helpful?