x-bind:value on an <input type=radio /> fails when used with wire:model under an x-for context #4468
Unanswered
adeng-kirbydrive
asked this question in
5. Bugs
Replies: 2 comments 1 reply
-
try entangle the livewire model: <div x-data="{ tabs: [{ name: 'tab1' }, { name: 'tab2' }], selectedTab: $wire.$entangle('tab') }">
<template x-for="tab in tabs" :key="tab.name">
<div>
<input type="radio" :value="tab.name" x-model="selectedTab" />
<div x-html="tab.name"></div>
</div>
</template>
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
-
It may be worth posting it in the Livewire project as well as I suspect it's more of a Livewire bug |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Component.blade.php:
Component.php:
Rendered HTML (inspect element):
tab.name is fine inside the
<div x-html="tab.name" />
elementNot fine inside the
<input ... />
element, because they both have a value of "tab1"Beta Was this translation helpful? Give feedback.
All reactions