filament/filament
v3.2.106
v11.21.0
v3.5.6
PHP 8.2.12
Have Filament Resource
with ListRecords
page.
On ListRecords
page, getTabs method is implemented (With All
and Some
tabs)
Table defined as reorderable
with condition, that All
tab is not reorderable.
class MenuItemResource extends Resource
{
// $model, $navigationIcon, ...
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')->required(),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name'),
])
->reorderable('order', fn (Page $livewire) => $livewire->activeTab !== 'all');
}
public static function getPages(): array
{
return [
'index' => Pages\ListMenuItems::route('/'),
];
}
}
class ListMenuItems extends ListRecords
{
protected static string $resource = MenuItemResource::class;
public function getTabs(): array
{
return [
'all' => Tab::make(),
'some' => Tab::make(),
];
}
}
When open dashboard and navigate to resource page, reorder button is hidden, when navigate Some
tab, it is still hidden.
If refresh the page on Some
tab, it works as expected. The problem happens only if navigated to the Resource page from another page (Dashboard or other Resources).
When navigate All
tab, reorder button should be hidden. When navigate Some
tab, reorder button should be displayed
This seems to be happening because the header toolbar container has the display: none style. Even though the button tends to be rendered.
As a temporary workaround I created custom action button, that calls toggleTableReordering
https://github.com/IlliaVeremiev/filament-reorderable-with-tabs-issue
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too