#Can't close modal from custom cancel action

6 messages · Page 1 of 1 (latest)

ripe crest
#

I have the following field with a suffix action

 TextInput::make('search')
    ->suffixAction(Action::make('foo')
        ->modalCancelAction(
            Action::make('cancel')
                ->action(function (Set $set,Action $action, $component, $livewire) {

                  //Why won't you close! (╯▔皿▔)╯
                    $livewire->close();
                    $action->cancelParentActions();
                    $action->halt();
                    return;
                })
                ->cancelParentActions( )
//              ->close()
//              ->after(function() {...})
        )

As you can see, I tried everything I could think of but the modal refuses to close!

The only thing that works is the commented out ->close() call, but then the code in the ->action() is not actually executed

#

Any ideas or suggestions welcome because I'm losing it

#

Can't close modal from custom cancel action

ripe crest
#

Ok nvm, the action doesn't appear to work at all. Don't know what I'm doing wrong tbh.

->extraModalFooterActions([
    Action::make('wtf')
        ->action(function() {
            dd('WTF is going on? Why not work?');
        }),
])
pulsar holly
#

Going to guess the 'Action' Class is the wrong action type to run in a footer.

ripe crest