livewire / flux

The official Livewire UI component library
https://fluxui.dev
475 stars 41 forks source link

checkbox livewire update not triggered if click is made on label #611

Closed jcerdan closed 6 days ago

jcerdan commented 1 week ago

Hi! 👋

I'm currently using a form with a checkbox. This checkbox has wire:model.live="enabled" I'm watching the value of enabled with var_export.

this is the code:

         {{ var_export($form->enabled) }}
          <flux:checkbox
              wire:model.live="form.enabled"
              label="Enabled?" />

looking the browser console you can see that the livewire update is only triggered if you click on the checkbox square. If you click on the checkbox label (Enabled?) the livewire update is not triggered.

I'm using last Fluxui 1.0.20 and last Livewire 3.5.12

Best regards

ju5t commented 1 week ago

Can confirm, this issues is new in 1.0.20. I've tested it with 1.0.19 and it does send a request to the backend there.

A fully copy/pasteable version:

<?php
\Livewire\Volt\state([
    'enabled' => false,
])
?>

<div class="flex p-6">
    <div class="space-x-0 space-y-3 lg:space-y-3 lg:space-x-0 lg:mt-0">
        @json($enabled)
        <flux:checkbox wire:model.live="enabled" label="Enabled?" />
    </div>
</div>
RezaODB commented 6 days ago

Also have the same problem on my app! I spent hours figuring out the issue! Thanks. A fix is needed asap please

calebporzio commented 6 days ago

This has been fixed and released: v1.0.21