Expanded checkbox clickable area to include label.

This commit is contained in:
Bilge
2024-11-13 18:04:23 +00:00
parent 9af3fe9c97
commit bff8e6b3ab

View File

@@ -14,8 +14,8 @@
'w-full' => $fullWidth,
])>
@if (!$hideLabel)
<label @class(['flex gap-4 px-0 min-w-fit label', 'opacity-40' => $disabled])>
<span class="flex gap-2">
<label @class(['flex gap-4 items-center px-0 min-w-fit label w-full cursor-pointer', 'opacity-40' => $disabled])>
<span class="flex flex-grow gap-2">
@if ($label)
{!! $label !!}
@else
@@ -25,11 +25,11 @@
<x-helper :helper="$helper" />
@endif
</span>
</label>
@endif
<span class="flex-grow"></span>
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}
@if ($instantSave) wire:loading.attr="disabled" wire:click='{{ $instantSave === 'instantSave' || $instantSave == '1' ? 'instantSave' : $instantSave }}'
wire:model={{ $id }} @else wire:model={{ $value ?? $id }} @endif />
@if (!$hideLabel)
</label>
@endif
</div>