->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
LeandroFerreiraβ€’2w ago
I think select doesn't have onblur
Asad Ali Haider
Asad Ali HaiderOPβ€’2w ago
Well select do have ->live() πŸ‘€
LeandroFerreira
LeandroFerreiraβ€’2w ago
yes, this will be triggered each time the select is changed
Asad Ali Haider
Asad Ali HaiderOPβ€’2w ago
Is there not anyway to trigger it when we leave the select?
LeandroFerreira
LeandroFerreiraβ€’2w ago
hum, I don't know
Want results from more Discord servers?
Add your server