An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(modal): use checkbox ids for Livewire bindings (#11335)
Andras Bacsai69dbfe00795f
diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.phpindex 8cc233a0c6..0e4350f50f 100644--- a/resources/views/components/modal-confirmation.blade.php+++ b/resources/views/components/modal-confirmation.blade.php@@ -236,7 +236,6 @@@foreach ($checkboxes as $index => $checkbox)<div class="flex justify-between items-center mb-2"><x-forms.checkbox fullWidth :label="$checkbox['label']" :id="$checkbox['id']"- :wire:model="$checkbox['id']"x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" /></div>diff --git a/tests/Feature/ModalConfirmationStep1NoCancelTest.php b/tests/Feature/ModalConfirmationStep1NoCancelTest.phpindex ec1425e7e3..0311cd0ecf 100644--- a/tests/Feature/ModalConfirmationStep1NoCancelTest.php+++ b/tests/Feature/ModalConfirmationStep1NoCancelTest.php@@ -1,5 +1,7 @@<?php+use Illuminate\Support\Facades\Blade;+/*** Step 1 (checkbox options) should only show Continue — dismiss is the header X.*/@@ -13,3 +15,17 @@ test('modal confirmation step 1 does not render a cancel button', function () {->toContain('step1ButtonText')->not->toContain('Cancel');});++test('modal confirmation lets checkbox ids define their Livewire model binding', function () {+ $checkbox = Blade::render(<<<'BLADE'+ <x-forms.checkbox id="deleteVolumes"+ x-on:change="toggleAction('deleteVolumes')"+ x-bind:checked="selectedActions.includes('deleteVolumes')" />+ BLADE);++ expect($checkbox)+ ->toContain('x-on:change="toggleAction(\'deleteVolumes\')"')+ ->toContain('x-bind:checked="selectedActions.includes(\'deleteVolumes\')"')+ ->toContain('wire:model=deleteVolumes')+ ->toMatch('/id="deleteVolumes-[a-zA-Z0-9]{24}"/');+});