Select component resets after save or state update
I have a simple form on custom page with select component but when I click on save button the it resets the select component (blank with no styling) and I get an error in console:
Uncaught (in promise) TypeError: Expected one of the following types text|select-one|select-multiple
Uncaught (in promise) TypeError: Expected one of the following types text|select-one|select-multiple
Test.php
public User $user; protected function getFormSchema(): array { return [ Card::make([ Select::make('business_model') ->options([...]) ->searchable(), Select::make('property_types') ->options([...]) ->multiple() ->reactive() ])->columns() ]; } protected function getFormModel(): Model|string|null { return $this->user; } public function save(): void { $this->user->update($this->form->getState()); $this->notify('success', 'Saved'); } public function mount(): void { $this->user = Auth::user(); $this->form->fill($this->user->toArray()); }}
public User $user; protected function getFormSchema(): array { return [ Card::make([ Select::make('business_model') ->options([...]) ->searchable(), Select::make('property_types') ->options([...]) ->multiple() ->reactive() ])->columns() ]; } protected function getFormModel(): Model|string|null { return $this->user; } public function save(): void { $this->user->update($this->form->getState()); $this->notify('success', 'Saved'); } public function mount(): void { $this->user = Auth::user(); $this->form->fill($this->user->toArray()); }}