filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.3k stars 2.96k forks source link

Fix Dropdown Width in Table When 'ActionGroup' Actions Are Buttons #14625

Closed A909M closed 3 weeks ago

A909M commented 3 weeks ago

Package

filament/filament

Package Version

v3.2.120

Laravel Version

11.29.0

Livewire Version

v3.5.12

PHP Version

8.3.12

Problem description

width dorp down ActionGroup when actions is Button

I encountered a layout issue in the Filament Tables component when using ActionGroupwith button-style actions. The dropdown width does not adjust correctly, leading to display problems. The solution could be to implement a conditional check to dynamically set the dropdown width.

Here’s an example of how I’m defining the ActionGroup:

ActionGroup::make([
    Tables\Actions\EditAction::make()->button(),
    Tables\Actions\ViewAction::make()->button(),
])

Expected behavior

Possible Fix: In the filament\support\resources\views\components\dropdown\index.blade.php file, apply a conditional check:

If the ActionGroup contains button-style actions, apply w-auto. If not, apply w-screen by default.

Steps to reproduce

  1. Define an ActionGroupwith button-style actions in a Filament table.
  2. Load the table and open the dropdown.
  3. Notice that the dropdown width is not optimal when button actions are used.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/A909M/filament-dropdown-issue

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

danharrin commented 3 weeks ago

Groups are essentially dropdowns, so they need to use the dropdown item view. There isn't currently a way to make them buttons and aligned horizontally, and I'm not interested in doing this right now. Thanks for reporting though.