->live(onBlur: true) is not working with Select when ->multiple() is true

Hey there, I'm using filament v3.2 and have a select element in my form. I'm enabling users to select multiple items and then want to perform custom action when user leaves the field. Curretly, I've tried using ->live(onBlur: true) but its not working. It trigger the ->afterStateUpdated() each time i select a value.
Select::make('products')
->label(__('Add Product'))
->searchable()
->multiple()
->getSearchResultsUsing(function (string $searchQuery) {
// custom query
})
->live(onBlur: true)
->afterStateUpdated(function ($state) {
// custom event
// dd($state) is triggering on each select
}),
Select::make('products')
->label(__('Add Product'))
->searchable()
->multiple()
->getSearchResultsUsing(function (string $searchQuery) {
// custom query
})
->live(onBlur: true)
->afterStateUpdated(function ($state) {
// custom event
// dd($state) is triggering on each select
}),
Looking forward to hear from you.
5 Replies
LeandroFerreira
LeandroFerreira2mo ago
I think select doesn't have onblur
Asad Ali Haider
Asad Ali HaiderOP2mo ago
Well select do have ->live() 👀
LeandroFerreira
LeandroFerreira2mo ago
yes, this will be triggered each time the select is changed
Asad Ali Haider
Asad Ali HaiderOP2mo ago
Is there not anyway to trigger it when we leave the select?
LeandroFerreira
LeandroFerreira2mo ago
hum, I don't know

Did you find this page helpful?