GuavaCZ / filament-clusters

Filament Clusters allows you to visually cluster multiple fields together.
MIT License
142 stars 6 forks source link

[Bug]: Button has a white background #13

Closed khanakia closed 2 months ago

khanakia commented 2 months ago

What happened?

I want to input Group with the button on the right it's not working

There is also no documentation I could find

Screenshot 2024-09-11 at 11 27 36 AM

How to reproduce the bug

Cluster::make([
                Forms\Components\TextInput::make("name")->maxLength(255)->required()
                ,
                Forms\Components\Actions::make([
                    Forms\Components\Actions\Action::make('Generate Slug')
                        ->icon('heroicon-s-bolt')
                        ->label('')
                        ->button()

                ]),
            ]),

Package Version

latest

PHP Version

8.2.-

Laravel Version

11

Which operating systems does with happen with?

macOS

Notes

No response

lukas-frey commented 2 months ago

Why don't you use suffix / prefix actions? And the color you can change using the color method on the actions.

khanakia commented 2 months ago

Would you happen to have an example?

I do not want to change the color it is just a Slug Generate Button which will take the name of the post and set the slug into the slug TextInput

lukas-frey commented 2 months ago

I'd do something like this:

Cluster::make([
    Forms\Components\TextInput::make("name")
        ->maxLength(255)
        ->required()
        ->suffixAction(Forms\Components\Actions\Action::make('Generate Slug')
            ->icon('heroicon-s-bolt')
            ->iconButton()
        ),
    ]),

https://filamentphp.com/docs/3.x/forms/actions#adding-an-affix-action-to-a-field

lukas-frey commented 2 months ago

Actually in your case, if you only want an action next to a text input, you don't need Clusters at all.

khanakia commented 2 months ago

Thanks