livewire / flux

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

Checkbox state not updated when clicked on the label #624

Closed Ashraam closed 5 days ago

Ashraam commented 5 days ago

Hi, there is this bug with checkbox.

When you click on the checkbox itself the state will be updated, but if you click on the label, it won't.

Here is the example code:

<?php

namespace App\Livewire;

use Livewire\Component;

class CheckboxTest extends Component
{
    public bool $test = false;

    public function render(): string
    {
        return <<<'blade'
            <div>
                <flux:checkbox wire:model.live="test" label="Test label" />

                <p>Is checkbox checked: {{ $test ? 'Yes' : 'No'}}</p>
            </div>
blade;
    }
}
lucasromanojf commented 5 days ago

Hello,

are you using version 1.0.20? It seems to be fixed on 1.0.21.

jeffchown commented 5 days ago

@Ashraam See https://github.com/livewire/flux/issues/601

Should be fixed if you update Flux to latest version.

calebporzio commented 5 days ago

Yep, thanks @lucasromanojf and @jeffchown

Ashraam commented 5 days ago

yes didn't see the update, thanks !