filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.51k stars 2.98k forks source link

ChoicesJS issue with ->searchable() and multiple action modals #2679

Closed pxlrbt closed 2 years ago

pxlrbt commented 2 years ago

Package

filament/filament

Package Version

v2.12.27

Laravel Version

v.8

Livewire Version

v2.10.5

PHP Version

PHP 8.0

Bug description

Fields\Select has a bug when used inside two different (action) modals with ->reactive() and ->searchable() that the placeholder disappears when selecting an option in the other modal. Doesn't happen when we add a different item before the Select. Feels like a diffing issue with LW?

protected function getActions(): array
{
    return [
        Action::make('action_1')
            ->action(fn ($data) => dd($data))
            ->form([
                // TextInput::make('text'),
                Select::make('name')->reactive()->searchable()->options([
                    1 => 'one',
                    2 => 'two',
                ]),

                Select::make('name_2')->reactive()->searchable()->options([
                    1 => 'one',
                    2 => 'two',
                ])
           ]),

        Action::make('action_2')
            ->action(fn ($data) => dd($data))
            ->form([
                Select::make('name_3')->reactive()->nullable()->searchable()->options([
                    1 => 'one',
                    2 => 'two',
                ])
           ]),
    ];
}

https://user-images.githubusercontent.com/22632550/172242525-e4e5db4d-620d-422a-a2cd-3fadaf34a4b2.mov

Steps to reproduce

No response

Relevant log output

No response

danharrin commented 2 years ago

Fixed in the latest version.