FilamentF
Filamentโ€ข5mo ago
Oussama

TableSelect V4 odd behaviour

Hello,

I know that this is v4, which is not out per se but I was hoping to shed some light on this.

I was aiming to achieve the following UI where there's an action, it opens a modal with a table and allows me to select multiple records.

I got it to work but in a weird way ๐Ÿ‘‡

Action::make('invite_crews')
    ->modalWidth(Width::FiveExtraLarge)
    ->schema([
        TableSelect::make('crew_ids')
            ->hiddenLabel()
            ->schema([
                // I have no idea why this makes multi-select work
                TextInput::make('literally_whatever_here')->hidden(), 
            ])
            ->tableConfiguration(AvailableCrewsTable::class)
            ->required()
            ->multiple(), // not enough on its own.
    ])


If remove the ->schema call with that hidden field, there won't be any multi-select related features (select all, deselect all) and won't be able to select more than one.

The TableSelect isn't documented as of yet AFAIK, so maybe I'm not supposed to use it directly?

The table configuration is fairly simple
public static function configure(Table $table): Table
{
    return $table
        ->query(fn () => Crew::query())
        ->columns([
            TextColumn::make('name')->searchable(),
            TextColumn::make('email'),
        ]);
}
image.png
Was this page helpful?