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.

<b-form-select> options and title?

See original GitHub issue

Hi are there any plans til implement support for title attribute on options (preferly rendered by the v-b-tooltip)?

Something like this:

<template>
  <div>
    <b-form-select v-model="selected" :options="options"></b-form-select>
select>
    <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        selected: null,
        options: [
          { value: null, text: 'Please select an option' },
          { value: 'a', text: 'This is First option' },
          { value: 'b', text: 'Selected Option' },
          { value: { C: '3PO' }, text: 'This is an option with object value' },
          { value: 'd', text: 'This one is disabled', disabled: true }
         { value: 'xyz', text: 'VeryComplex option', title:'My very good description for the complex option'}
        ]
      }
    }
  }
</script>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jan 17, 2020

There are no plans yet for adding title attributes (also note v-b-tooltip will not work as expected on <option> elements).

You can, however, do the following to get the title attributes set:

<template>
  <div>
    <b-form-select v-model="selected">
      <option
         v-for="(option, idx) in options"
         :key="idx"
         :value="option.value"
         :title="option.title || null"
      >
        {{ option.text }}
      </option>
    </b-form-select>
select>
    <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
  </div>
</template>

The default slot of <b-form-select>’ provides you greater control over how the options are rendered.

0reactions
stale[bot]commented, Apr 25, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Select | Components - BootstrapVue
Generate your select options by passing an array or object to the options props: ... Feel free to mix the options prop with...
Read more >
Pass selected option <b-form-select> to axis post from child to ...
All my input fields are getting passed but I can't get the value in the <b-form-select> to pass. How do I pass the...
Read more >
v-model on b-form-select not working - CodePen
Adding Classes. In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template....
Read more >
Form | Components | BootstrapVue - API Manual
Form. BootstrapVue form component and helper components that optionally support inline form styles and validation states.
Read more >
Vue Select - examples & tutorial. Bootstrap & Material Design
Vue Bootstrap 5 Select. Vue Select fields components are used for collecting user provided information from a list of options. Note: Read the...
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