Dependent select searchable
I can't seem to make this work. The second selection doesn't seem to populate.
If I use the options ()instead of getSearchResultsUsing() and
getOptionLabelUsing() Without searchable(), the second selection populates but doesn't clear it. But I want both of the selects is searchable.
14 Replies
The second selection doesn't seem to populateDid you search for anything? Otherwise there are no values. You need
->preload()
if you want values before searching.
If I use the options ()instead of getSearchResultsUsing() and getOptionLabelUsing() Without searchable(), the second selection populates but doesn't clear it.What do you mean by: Doesn't clear it? Why should it be cleared? If you want to clear the second select after selecting a value in the first one, you need to add something like this on the first select: PS: On the second select you query
Folder
but try to get an option for Drawer
.
If I comment searchable() the $get() will get the drawer_id, but if uncomment it, it will get a null value. That's why I can't query in the second select when using searchable in both select.
It's
null
after you selected a value in the first select?yes after I selected the first select which is the drawer
Hmm. Weird one. Can you make sure you are on the latest versions of Livewire and Filament?
Here's a video comparison with searchable() commented and not
I attached video also for reference
Can you check
fn ($livewire) => dd($livewire->data)
on getSearchResultsUsing()
it returns empty array
Is this ever fired on the first select
->afterStateUpdated(fn (Set $set) => dd('state updated')
?afterStateUpdated() doesn't fire the dd(), but if I comment out searchable() it fires.
Okay, so this seems like a Filament or Livewire bug. Can you report this on GitHub please?
@Dan Harrin Are there any known issues with searchable Select fields not working
live()
?Okay I will, thanks
not as far as I remember