We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello !
I'm having a problem using live components to bind an entity to a radio button.
Context: I have a list of product variants. When I check the button, the value is stored on the back side, but uncheck the button directly.
I tested with a select and the binding works fine.
<?php ... uses #[AsLiveComponent] final class ProductForm extends AbstractController { #[LiveProp(writable: true, url: true)] public ?ProductVariant $productVariant = null; ... }
<div class="flex flex-col mb-4 gap-3"> {% for variant in this.variants %} <div> <input type="radio" value="{{ variant.id }}" data-model="productVariant" id="variant_{{ variant.id }}" {{ variant.getNumberOfAvailableCode == 0 ? 'disabled' : '' }} class="hidden peer" required /> <label for="variant_{{ variant.id }}" class="inline-flex items-center justify-between w-full p-5 text-gray-500 bg-gray-100 border border-gray-200 peer-disabled:bg-gray-200 rounded-lg cursor-pointer peer-checked:border-blue-600 peer-checked:text-blue-600 hover:text-gray-600 hover:bg-gray-100"> <span class="flex flex-col"> <span class="underline">{{ variant.name }}</span> {{ 'products.available'|trans({"%availables%": variant.getNumberOfAvailableCode}) }} </span> <span class="inline-flex items-center justify-center ms-2 w-20 h-6 text-xs font-semibold bg-blue-200 rounded-full"> {{ variant.price }} € </span> </label> </div> {% endfor %} </div>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello !
I'm having a problem using live components to bind an entity to a radio button.
Context: I have a list of product variants. When I check the button, the value is stored on the back side, but uncheck the button directly.
I tested with a select and the binding works fine.
The text was updated successfully, but these errors were encountered: