Closed DCodeMania closed 2 months ago
Try using only wire:click only, if you use target then you usually use wire:loading with it https://livewire.laravel.com/docs/wire-loading
Try using only wire:click only, if you use target then you usually use wire:loading with it https://livewire.laravel.com/docs/wire-loading
I also tried only wire:click without wire:target but still when I click on delete button then edit action is also triggered.
Try taking out @row-click and clear caches
Try taking out @row-click and clear caches
@andrew-m-p, removing @row-click worked. Thank you so much! However, can't I use @row-click as well?
Depends on what you are after, if you use row click then the contents of the whole row are clickable, but that might include buttons etc.
Depends on what you are after, if you use row click then the contents of the whole row are clickable, but that might include buttons etc.
I believe this issue needs to be resolved. The goal is to ensure that anyone can use @row-click and multiple action buttons within a Table component. @robsontenorio
Did you try wire:click.stop
? It stops event propagation, which sounds like what you want - click on the action, but stop the event from triggering "row click".
No matter what button will click, the @row-click
will be invoked.
@EdgarsJoja That is correct ! You need the .stop
.
<x-button wire:click="edit({{ $user->id }})">Edit</x-button>
<x-button wire:click.stop="remove({{ $user->id }})">remove</x-button>
maryUI version
1.34
daisyUI version
4.12.10
Livewire version
3.5
What browsers are affected?
Firefox, Chrome, Safari, Microsoft Edge
What happened?
When I use two actions on a Table component, clicking the remove button also triggers the edit method. However, when I click the edit button, it works fine. I'm not sure where the issue is. Below is the code:
Blade View Codes of Table component:
Livewire component class code: