#Nested wire:click should not trigger parent

3 messages · Page 1 of 1 (latest)

native bridge
#

Hi there,

I have a Livewire component with nested links like this:

<x-file-card wire:click="attachFileToUser({{ $file }})">
  <a href="#" wire:click="openPreviewModal({{ $file }})">Preview</a>
  <a href="#" wire:click="openDeleteModal({{ $file }})">Delete</a>
</x-file-card>

Obviously, if I click on one of the "inner" links, the outer link gets also triggered. How can I prevent this from happening? I want to allow users to preview a file without attaching it to the user...

Thank you 😘

toxic perch
#

I think you can do wire:click.prevent

native bridge
#

Unfortunately not. Already tried this.