What seems to be the problem:
wire:target in blade with @if seem not working as expected. (please see video) What to expect: i click the “run” method, the buttons with wire:target=“run” will be disabled. and after the status running, the action will change and when i click the “stop” , the buttons wire:target=“stop” should be disabled.
Why did it not disabled ?
Code:
<x-table.cell class="d-flex justify-content-end">
@if($botserver->status->value === "inactive")
<x-button.success wire:loading.attr="disabled" wire:click="run" class="btn-sm"><i class="icon ion-play"></i> Start</x-button.success>
<x-button.edit wire:loading.attr="disabled" wire:target="run" wire:click="showEdit" class="mg-l-10">Edit</x-button.edit>
<x-button.delete wire:loading.attr="disabled" wire:target="run" wire:click="showDelete" class="mg-l-10">Delete</x-button.delete>
@else
<x-button.success wire:loading.attr="disabled" wire:target="stop" wire:click="viewContainer" class="btn-sm"><i class="icon ion-eye"></i> View</x-button.success>
<x-button.restart wire:loading.attr="disabled" wire:target="stop" wire:click="restart" class="mg-l-10">Restart</x-button.restart>
<x-button.stop wire:loading.attr="disabled" wire:click="stop" class="mg-l-10">Stop</x-button.stop>
@endif
</x-table.cell>
Are you using the latest version of Livewire: yes
Do you have any screenshots or code examples:
https://drive.google.com/file/d/1tTrVcNB367x40y9BoozDx2_yvTlbUNLk/view?usp=sharing