Wire:target - Not working as expected

I’ve got 2 file inputs within my component “avatar & banner”.

I’ve also got 2 buttons to act as different states when loading a file is being selected and when its being uploaded.

If I add a file to the banner input, it displays the Updating... and removes the Update button as expected.

But when actually start uploading the file my wire:uploading wire:target="banner" doesnt work as expected. The Updating... button doesnt appear.

My Buttons:

<button wire:loading.remove wire:target="banner" wire:click="updateProfile('banner')" class="primary small">Update</button>
<button wire:loading wire:target="banner" class="primary disabled small" disabled>Updating...</button>

Hey, @AtomCoder

You can do something like this:

<button wire:loading.target="banner" ...>...</button>

No, that doesn’t seem to work either.

I’ve also tried this (just adding disabled class & attr to current button):

<button wire:loading.class="disabled" wire:loading.attr="disabled" wire:target="banner" wire:click="updateProfile('banner')" class="primary small">Update</button>

I noticed when I populate the file input field, livewire applies the class and attr to the button, but when I click the button again to upload the banner, there’s no interaction from livewire on the button. No class or attr added, any ideas?

I think your target is wrong.
try this
wire:target=“updateProfile”