wire:confirm not working on checkbox
Hello, I would have a confirm dialog when checking a checkbox, I tried this but the dialog does not appear
<input type="checkbox" wire:model.live="trackingClosed" wire:confirm="Êtes-vous sûr(e) de vouloir clôturer ce suivi ?" >
Thanks for your help
There is no action on the checkbox; e.g. there is no wire:click directive, so nothing to trigger.
ok, I got a dialog box but if i click cancel the action is performed. there is nos solution to perform this ?
I tried with alpine and not better
@Eloïse can you share what you have done to get the dialog?
Sure ! :)
<div wire:key="{{ $tracking_id }}" x-data="{tracking_closed: @entangle('trackingClosed') }">
@can(\App\enums\PermissionsEnum::CLOSE_VEHICLE_TRACKING->value)
{{-- pinkTrackingOpen --}}
<div class="flex">
<div class="mr-2">
<input x-bind:disabled="tracking_closed"
x-bind:readonly="tracking_closed"
type="checkbox"
wire:model.live="trackingClosed"
x-bind:checked="tracking_closed"
wire:click="closeTracking"
wire:confirm="Êtes-vous sûr(e) de vouloir clôturer ce suivi ?" >
</div>
<div>
<span
x-bind:class="tracking_closed ? 'italic text-gray-400': ''"
x-text="tracking_closed ? 'Clôturée le {{ $tracking->locked_at?->format('d-m-Y') }}' : 'Clôturer la fiche'"></span>
</div>
</div>
@endcan
</div>
Please or to participate in this conversation.