Hi, I have a list of buttons:
<button wire:delete-confirmation="deleteMenuItem({{ $item->id }})" wire:loading.attr="disabled">
When one button is clicked, all the other buttons are also disabled. I’ve tried adding wire:target=deleteMenuItem({{ $item->id }}) but it didn’t work.
Loading attributes affect on all buttons
Try to attach IDs to you Livewire component in your blade @livewire directive.
still doesn’t work, all the buttons are inside one directive, where should I put the id?
Ah, ok. Sorry. Actually ‘loading’ state is valid for whole component (and all elements on it), not for one element. The only thing I can think of is breakdown your component into one main and sub components with delete buttons. Then it should work.
Thank you, sub component works for me
One more question, How can I reload the parent component?
Actually I have a question! How this bit is working?
I cannot find anything like this in documentation!
I’m using a custom directive, something like this: https://github.com/livewire/sortable/blob/master/src/index.js
Thanks! Very interesting!