F
Filament12mo ago
12T

Fields Repeater, can't be deleted

I think it's not working properly. I've attached a video of the problem. my code.
Forms\Components\Section::make('Port')
->description('ระบุ Port Numer หรือชื่อ Port Name ที่ต้องการเชื่อต่อ')
->schema([
Forms\Components\Repeater::make('ports')
->label('')
->schema([
Forms\Components\Select::make('port_type')
->label('Port Type (โดยทั่วไปจะเป็น TCP)')
->options([
'tcp' => 'TPC',
'udp' => 'UDP',
])
->live()
->default('tcp')
->native(false)
->required(),
Forms\Components\TextInput::make('port_number')
->label('Port Namber')
->id('port_number')
->maxLength(255)
->required(fn (Get $get): string => !$get('port_name')),
Forms\Components\TextInput::make('port_name')
->label('Port Name')
->maxLength(255)
->required(fn (Get $get): string => !$get('port_number')),
])
->itemLabel(fn (array $state): ?string => strtoupper($state['port_type'] ?? ''))
->reorderableWithDragAndDrop(false)
->addActionLabel('Add Port')
->cloneable()
->minItems(1)
->columns(3),
])
->collapsible()
->compact()
Forms\Components\Section::make('Port')
->description('ระบุ Port Numer หรือชื่อ Port Name ที่ต้องการเชื่อต่อ')
->schema([
Forms\Components\Repeater::make('ports')
->label('')
->schema([
Forms\Components\Select::make('port_type')
->label('Port Type (โดยทั่วไปจะเป็น TCP)')
->options([
'tcp' => 'TPC',
'udp' => 'UDP',
])
->live()
->default('tcp')
->native(false)
->required(),
Forms\Components\TextInput::make('port_number')
->label('Port Namber')
->id('port_number')
->maxLength(255)
->required(fn (Get $get): string => !$get('port_name')),
Forms\Components\TextInput::make('port_name')
->label('Port Name')
->maxLength(255)
->required(fn (Get $get): string => !$get('port_number')),
])
->itemLabel(fn (array $state): ?string => strtoupper($state['port_type'] ?? ''))
->reorderableWithDragAndDrop(false)
->addActionLabel('Add Port')
->cloneable()
->minItems(1)
->columns(3),
])
->collapsible()
->compact()
5 Replies
Patrick Boivin
Patrick Boivin12mo ago
Could be a bug, there are known issues at the moment with Repeater and Builder fields.
awcodes
awcodes12mo ago
this is a know LW issue and has been submitted to LW.
evodiaaut
evodiaaut12mo ago
GitHub
small bugs in demo or core? · Issue #73 · filamentphp/demo
If you delete more than 2 order items its generate blank order items https://demo.filamentphp.com/shop/orders/1/edit If you finish to sort a brand he start random shuffling for all brands? https://...
justgkp
justgkp11mo ago
me to facing the same issue.
josef
josef11mo ago
It's fixed in livewire, just waiting on a new release, then filament gets an update and it will work again