question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form Radio Label 'for' attribute not set while using with nuxt

See original GitHub issue

I 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.

image

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:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mosinvecommented, May 16, 2018

Strange, as main BV docs site built on Nuxt and radios working perfectly.

2reactions
Pryscycommented, May 16, 2018

Same problem for me

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found