Form Radio Label 'for' attribute not set while using with nuxt
See original GitHub issueI am using Bootstrap-vue in my Nuxt project.
Bootstrap-vue version: ^2.0.0-rc.9
Browser: Chrome
The Form Radio is produced via for loop using data from backend. Initially I observed some of checkboxes and radio buttons un-clickable. Looking into the html markup of the same, we can identify that the label
tag is not having for
attribute that can access the original underlying radio control.
Sample Code: `
<div :class="$style.licenses">
<b-form-radio-group :checked="selectedLicense.id" @change="onChange">
<b-form-radio
v-for="license in licenses"
:key="license.id"
:value="license.id"
:class="$style.license"
>
<span>{{ license.name }}</span>
<template
v-if="license.downloaded_by_user"
>
<span
:class="[$style.price, $style.purchased]"
>
Purchased
</span>
</template>
<price
v-else
:amount="license.price"
:class="$style.price"
></price>
</b-form-radio>
</b-form-radio-group>
</div>
`
I tried with nuxt in production mode too, but it’s acting the same. It doesn’t work even if I put a form-radio component without for some components, while it works while hot-reloading of the component.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Form Radio | Components - BootstrapVue
To pre-check a radio, you must set the v-model value to the one of the radio's value (i.e. must match the value of...
Read more >Nuxt3: Why are selected radio buttons not shown when using ...
When user selects a radio option, the URL changes to reflect the change (ie, 'solved', 'unsolved' radio options). This works good, however, the ......
Read more >Form Input Bindings - Vue.js
To guarantee that one of two values is submitted in a form (e.g. "yes" or "no"), use radio inputs instead. Radio #. template...
Read more >Creating Custom Inputs With Vue.js - Smashing Magazine
This tutorial aims to help you understand how v-model works on native inputs and on custom components by default. Also, you'll learn how...
Read more >Styling — Essentials ⚡️ FormKit — Vue Forms, Supercharged
data-errors — Present when the input has explicitly set errors. You can use the above attributes to easily provide realtime visual feedback for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Strange, as main BV docs site built on Nuxt and radios working perfectly.
Same problem for me