awcodes / filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.
MIT License
201 stars 43 forks source link

extraItemActions() not showing if all other actions (like clone, reorder, ...) are disabled #116

Closed martindj closed 5 months ago

martindj commented 5 months ago

Filament Version

v3

Plugin Version

v3.0.2

PHP Version

PHP 8.3.0

Problem description

When all "default" actions per row are disabled, the row-actions column is not shown. This means that the extraItemActions are not displayed.

Expected behavior

The row actions column should be visible

Steps to reproduce

TableRepeater::make('myItems')
        ->headers([...])
        ->schema([...])
        ->extraItemActions([
                Action::make('someAction'),
        ])
        ->addable(false)
        ->reorderable(false)
        ->deletable(false)

Reproduction repository

No response

Relevant log output

No response

martindj commented 5 months ago

The fix MIGHT be as simple as adding || filled($visibleExtraItemActions) to the $hasActions variable in table-repeater.blade.php , but I don't know this plugin well enough to know if this will cause any unwanted side effects

    $hasActions = $reorderAction->isVisible()
        || $cloneAction->isVisible()
        || $deleteAction->isVisible()
        || $moveUpAction->isVisible()
        || $moveDownAction->isVisible()
        || filled($extraItemActions)
        || filled($visibleExtraItemActions); // This line added