#requiresConfirmation doesn't seem to work on form submit action

8 messages · Page 1 of 1 (latest)

daring bone
#

hi all!
I'm adding a custom form on a custom page but can't seem to add requiresConfirmation() to the form submit.

The Form part:

        return $form
            ->schema([
                Select::make('tags')
                    ->options($tags ? array_combine($tags, $tags) : [])
                    ->required()
                    ->minItems(1)
                    ->multiple()
                    ->searchable()
            ])
            ->statePath('clearCacheFormData');

The blade;

<x-filament-panels::page>

        <x-filament::section>
            <x-slot name="heading">
                Cache legen
            </x-slot>

            <form wire:submit="clearCache">
                <div class="mb-4">
                    {{ $this->clearCacheForm }}
                </div>

                <x-filament-panels::form.actions :actions="[$this->getClearCacheSaveAction()]"/>
            </form>
        </x-filament::section>

The action method;

    public function getClearCacheSaveAction(): Action
    {
        return Action::make('save')
            ->label('Geselecteerde caches legen')
            ->requiresConfirmation()
            ->submit('clearCache');
    }
  • Why is the requiresConfirmation not firing?
  • Do you see general improvements in this custom form approach?

Thanks!!

deft whaleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

quiet raven
dire stump
daring bone
daring bone
dire stump
daring bone