Repository: filamentphp/filament

Issue #3068: Disabled on select in repeater not reactive
Created: 2022-07-08T14:48:29Z
Package
filament/forms
Package Version
v2.13.24
Laravel Version
9.11
Livewire Version
No response
PHP Version
8.0.2
Bug description
With the following form schema when i try to change the disabled state of the itemable_id with the reactive itemable_type field it stays disabled.
Also the repater is empty even with defaultItems(1).
        return [
            Forms\Components\Repeater::make('items')
                ->schema([
                    Forms\Components\Select::make('itemable_type')
                        ->label('Type')
                        ->options([
                            DockerContainerPort::class => 'Container Port'
                        ])
                        ->reactive()
                        ->required()
                        ->afterStateUpdated(fn (callable $set) => $set('itemable_id', null)),
                    Forms\Components\Select::make('itemable_id')
                        ->label('Item')
                        ->required()
                        ->unique(table: Item::class)
                        ->disabled(fn (\Closure $get) => empty($get('itemable_type')))
                        ->searchable()
                        ->getSearchResultsUsing(fn (\Closure $get, string $search) => $this->searchContainerPorts($get('itemable_type'), $search)),
                    Forms\Components\Toggle::make('active')->default(true),
                    Forms\Components\Toggle::make('new_tab'),
                    Forms\Components\Toggle::make('only_admin'),
                ])
                ->defaultItems(1)
                ->disableItemMovement(),
        ];
Reproduction repository
https://github.com/Walter-Melon/filament-select-example
Steps to reproduce
It appears the disabled closure does not work with searchable select fields.
Relevant log output
No response

Duplicate issue #10333: Livewire select searchable, disabled with live and dependencies isn't working
Created: 2023-12-15T19:10:38Z
Package
filament/filament
Package Version
v3.1.18
Laravel Version
v10.35.0
Livewire Version
v3.2.6
PHP Version
8.2.12
Problem description
I'm trying to create multiple selects with dependecies between them, I want the selects to be searchable, all of them.
When I make them searchable they simply don't work anymore, but as long as they are not searchable they work as expected

WITH SEARCHABLE
Before selecting anything

After selecting main you notice it's NOT disabled but the values are no populated, or the placeholder

WITHOUT SEARCHABLE
Before selecting anything

After selecting main notice it's NOT disabled and the placeholder is populated as well as the values


From debugging I can see in ray the values when I change the values using
I've achieved this by having an updated method to hook into livewire lifecycles
After select the main:
$this->data

$this->form->getState()

Expected behavior
I'm expending that when the selects are searchable to behave in the same way as when they are not but with the nice html and search input AKA native false
Steps to reproduce
Clone repo
npm install
npm run build
artisan serve
Check web.php for component
Reproduction repository
https://github.com/eduardichim/filament-bug
Relevant log output
No response
PS:
After some more testing it looks like that the disable is causing this, removing the disabled logic works as expected

Closing comment (2023-12-15T21:33:17Z): Duplicate of #3068