affixes

hello guys, is there a way to make the suffixAction() or prefixAction() to be a button instead of an icon button? just a rectangular button.
7 Replies
Dennis Koch
Dennis Koch2y ago
Not sure. Did you try ->button() on the Action?
darwin
darwinOP2y ago
i already did but its not included in the function for Action, whenever i try to remove the icon() it just gives me an error
Dennis Koch
Dennis Koch2y ago
Then it's probably not possible right now. You could try Awcodes #drop-in-action instead
darwin
darwinOP2y ago
i read the documentation but i find it really confusing as it only gave 1 example. thank you though sir for responding!
TextInput::make('code')
->suffixAction(
fn (?string $state): DropInAction => DropInAction::make('code')
->disableLabel()
->execute(fn () => Action::make('code')
->label('Generate')
->action(fn (TextInput $component) => $component->state(Discount::generateDiscountCode()))),
),
TextInput::make('code')
->suffixAction(
fn (?string $state): DropInAction => DropInAction::make('code')
->disableLabel()
->execute(fn () => Action::make('code')
->label('Generate')
->action(fn (TextInput $component) => $component->state(Discount::generateDiscountCode()))),
),
this is how i did it but it doesnt seem to work, it gives me this error: Method Awcodes\DropInAction\Forms\Components\DropInAction::component does not exist.
Dennis Koch
Dennis Koch2y ago
DropInAction is a separate Field. Not a suffix Action
darwin
darwinOP2y ago
okay thanks sir, i think this is really not possible as of now
Dennis Koch
Dennis Koch2y ago
You can use DropinAction as a separate Field and add an Action in there. That should be possible. But not as a suffix action
Want results from more Discord servers?
Add your server