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.
])
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'),
]);
}
public static function configure(Table $table): Table
{
return $table
->query(fn () => Crew::query())
->columns([
TextColumn::make('name')->searchable(),
TextColumn::make('email'),
]);
}
No description
6 Replies
Oussama
OussamaOP3mo ago
I'm aware of that component but that's a field that opens a modal, while the goal here was an action that opens the modal Instead of doing: Action opening a Form then opening ModalTableSelect
Dennis Koch
Dennis Koch3mo ago
@Dan Harrin Is this internal only? Or a bug?
Dan Harrin
Dan Harrin3mo ago
TableSelect is not documented because lots of the behaviour needed to make it work belongs in the ModalTableSelect. Use at your own risk, but I wouldn’t.
Oussama
OussamaOP3mo ago
That confirms my suspicion, thanks for the clarification Initially thought it was part of the new components because of IDE autocomplete only to realize it wasn't documented afterwards 😁
Dennis Koch
Dennis Koch3mo ago
Should we mark stuff like this as @internal?

Did you find this page helpful?