rgeraads
rgeraads
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
Yes, requiresConfirmation is ignored
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
Yeah that works, I said that above. But even in this example if you remove requiresConfirmation you will get the same result
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
What do you get if you remove requiresConfirmation?
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
requiresConfirmation doesn’t do anything in that example. It is overruled by modalDescription
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
so what does requiresConfirmation do?
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
requiresConfirmation is ignored even, because this does show a modal
Action::make('generatePassword')
->requiresConfirmation(false)
->modalDescription('Are you sure you want to do this?')
->modal(true)
->action(function () {}),
)
Action::make('generatePassword')
->requiresConfirmation(false)
->modalDescription('Are you sure you want to do this?')
->modal(true)
->action(function () {}),
)
and this doesn't
Action::make('generatePassword')
->requiresConfirmation(true)
->modalDescription('Are you sure you want to do this?')
->modal(false)
->action(function () {}),
)
Action::make('generatePassword')
->requiresConfirmation(true)
->modalDescription('Are you sure you want to do this?')
->modal(false)
->action(function () {}),
)
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
requiresConfirmation can be omitted and you'd have the same result, only using modal true/ false
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
Action::make('generatePassword')
->requiresConfirmation(true)
->modalDescription('Are you sure you want to do this?')
->modal(false)
->action(function () {}),
Action::make('generatePassword')
->requiresConfirmation(true)
->modalDescription('Are you sure you want to do this?')
->modal(false)
->action(function () {}),
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
that condition causes no modal in any case
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
this does what i want
Action::make('generatePassword')
->modalDescription(function (User $user) {
if (! $user->isAdmin()) {
return 'are you sure?';
}
})
Action::make('generatePassword')
->modalDescription(function (User $user) {
if (! $user->isAdmin()) {
return 'are you sure?';
}
})
which is weird, because the if (! $user->isAdmin()) { logic should be in requiresConfirmation
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
the only way i can make it to work is by putting the condition in the modalDescription callback. but i find that weird, why doesn't requiresConfirmation overrule the modalDescription?
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
TextInput::make('test')
->suffixAction(
Action::make('test')
->requiresConfirmation(fn () => false)
->modalDescription(function () {
return 'test';
})
)
TextInput::make('test')
->suffixAction(
Action::make('test')
->requiresConfirmation(fn () => false)
->modalDescription(function () {
return 'test';
})
)
the modal still pops up
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
but it always pops up
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
i dont want the confirmation to show in some conditions
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
resource -> form builder
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
the example is merely an example
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
I do use that
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
and in protected function getFormActions(): array
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
in my form as a suffixAction on a textInput
64 replies
FFilament
Created by rgeraads on 1/24/2025 in #❓┊help
Conditional requiresConfirmation ignored
that's why i think this is a bug
64 replies