How to get the deselect item on SelectColumn with multiple options.
Is it possible that get the deselect item on multiple select options.
With afterStateUpdate method
13 Replies
Do you want to get a list of the items that were deselected, after clicking the Deselect action?
Ya, I want exactly that
I'm curious to know more about your use case.
I have a select field with multiple, I can select multiple options, If I deselect one of them, then I want that deselected Item data
Sure, I understand what you want to do. I'm curious to know why. What do you want to do with the information of the deselected items?
Here the Admin have predefine set of permission, In this dropdown If I choose
Admin
on roles then it auto fill Permission
with associated permission, if I remove the one of the Permission
then it also remove the Admin
as well this my use caseInteresting, thanks. I wonder if you could use Livewire's
updating
and updated
hooks for this :
https://livewire.laravel.com/docs/lifecycle-hooks#update
In updating
, you would have access to the current permissions and the new permissions being updated.
I just realized that afterStateUpdated()
can also give you the old value of the field. Something to try.
https://filamentphp.com/docs/3.x/forms/advanced#field-updatesFor select it return the current state
have you checked the docs link? There is a
?string $old
injectYa checked
But I wonder why even allow to select permissions?
If user want to other individual permission, then they can choose from the permission dropdown
Hm. Why not show permissions that aren't attached to selected role?