F
Filament6mo ago
ericmp

modalSubmitActionLabel on v2 equivalent?

on v3, in an action, u do: ->modalSubmitActionLabel('hi') on v2 idk how to do it: i try: ->modalSubmitAction(fn ($action) => $action->label('hi')) i get: Filament\Support\Actions\Action::getModalSubmitAction(): Return value must be of type Filament\Support\Actions\Modal\Actions\Action, Filament\Tables\Actions\Action returned the objective is to change the submit button label
4 Replies
Tetracyclic
Tetracyclic6mo ago
Would this work:
->modalSubmitAction(function ($action) {
$action->label('hi'))
return $action->makeModalAction('action-name');
}
->modalSubmitAction(function ($action) {
$action->label('hi'))
return $action->makeModalAction('action-name');
}
https://github.com/filamentphp/filament/blob/995326f6fcb41bc7a9f64957a489c0db372206d9/packages/tables/src/Actions/Action.php#L67
ericmp
ericmpOP6mo ago
it doesnt. it moves the action on modal left bottom place (instead the right bottom location where it was) and on click does nothing. seems is a new action, unconfigured. also the label is not hi, it says "Action name"
Tetracyclic
Tetracyclic6mo ago
Can you share more of the code? Presumably it's a table action?
ericmp
ericmpOP6mo ago
is a table header action, but dont worry i solved it by overriding translations - file lang/vendor/filament-support/en/actions/modal.php
Want results from more Discord servers?
Add your server