Select field UI bug

Happen on a repeater
No description
9 Replies
Rolland
RollandOP2w ago
// RFP Items with vendors

Repeater::make('rfp_items')
->label('RFP Items')
->schema([
Grid::make(2)
->schema([
self::getRequestorSection(),
self::getAdminSection(),
])
->columnSpanFull(),
])
->addActionLabel('Add Item')
->deleteAction(
fn (Action $action) => $action
->requiresConfirmation(),
)
->reorderable(false)
->collapsible()
->itemLabel(fn (array $state): ?string => isset($state['request_item_id'])
? self::getRequestItem($state['request_item_id'])?->item_name ?? 'Item'
: 'New Item'
)->extraAttributes([
'class' => 'h-full max-h-[calc(100vh-2.5rem)] overflow-y-auto p-1',
]),
// RFP Items with vendors

Repeater::make('rfp_items')
->label('RFP Items')
->schema([
Grid::make(2)
->schema([
self::getRequestorSection(),
self::getAdminSection(),
])
->columnSpanFull(),
])
->addActionLabel('Add Item')
->deleteAction(
fn (Action $action) => $action
->requiresConfirmation(),
)
->reorderable(false)
->collapsible()
->itemLabel(fn (array $state): ?string => isset($state['request_item_id'])
? self::getRequestItem($state['request_item_id'])?->item_name ?? 'Item'
: 'New Item'
)->extraAttributes([
'class' => 'h-full max-h-[calc(100vh-2.5rem)] overflow-y-auto p-1',
]),
Jonathan Christiani
Show your select code
Rolland
RollandOP2w ago
Select::make('request_item_id')
->label('Requested Item')
->native(false)
->options(function (?Model $record) {
if (! $record) {
return [];
}

return $record->requestItems->mapWithKeys(function ($requestItem) {
return [$requestItem->id => "$requestItem->item_name (Qty: $requestItem->quantity)"];
});
})
->required()
->live()
->afterStateUpdated(function ($state, callable $set) {
if ($state) {
$requestItem = self::getRequestItem($state);
if ($requestItem) {
$set('currency_id', $requestItem->currency_id);
$set('requested_qty', $requestItem->quantity);
$set('unit_price', $requestItem->estimated_price);
$set('total', $requestItem->quantity * $requestItem->estimated_price);
}
}
}),
Select::make('request_item_id')
->label('Requested Item')
->native(false)
->options(function (?Model $record) {
if (! $record) {
return [];
}

return $record->requestItems->mapWithKeys(function ($requestItem) {
return [$requestItem->id => "$requestItem->item_name (Qty: $requestItem->quantity)"];
});
})
->required()
->live()
->afterStateUpdated(function ($state, callable $set) {
if ($state) {
$requestItem = self::getRequestItem($state);
if ($requestItem) {
$set('currency_id', $requestItem->currency_id);
$set('requested_qty', $requestItem->quantity);
$set('unit_price', $requestItem->estimated_price);
$set('total', $requestItem->quantity * $requestItem->estimated_price);
}
}
}),
Jonathan Christiani
So what is the bug?
Rolland
RollandOP2w ago
take a look at the image the dropdown is not align with the field
Jonathan Christiani
Did u run npm run build?
Rolland
RollandOP2w ago
i did and that does not solve the problem
toeknee
toeknee2w ago
You probably have a plugin loading some CSS/JS that's causing it. Inspect the source and see what's causing it / which css file is affecting it.
Rolland
RollandOP6d ago
GitHub
Select dropdown position follows modal width size · Issue #18491 ...
Package filament/filament Package Version v4.2.0 Laravel Version v12.38.0 Livewire Version v3.6.4 PHP Version v8.4.13 Problem description The dropdown is positioned far from the Select fields: Expe...

Did you find this page helpful?