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.

BFormSelect not rendering dropdown selection

See original GitHub issue

Describe the bug

I’m getting an error: Error in render: "TypeError: Cannot convert undefined or null to object". It was rendering some days ago. However, when I returned to the form yesterday, I noticed that all the select fields were not rendering.

Steps to reproduce the bug

  1. The options prop is set to a Vuex getter.
  2. Vuex state is populated with data via an axios called made before route is entered.

Expected behavior

BFormSelect should render. Other input field such as BInput are rendering.

Versions

Libraries:

  • BootstrapVue: 2.0.0-rc.24
  • Bootstrap: 4.3.1
  • Vue: 2.6.11

Environment:

  • OS: Windows 10
  • Browser: Chrome
  • Version: 80.0.3987.163 (Official Build) (64-bit)
<b-input-group
  class="inputGroup"
  id="nameOfOrgInputGroup"
>
  <b-input-group-prepend>
    <b-input-group-text>
      <i
        class="icon-user"
      ></i>
    </b-input-group-text>
  </b-input-group-prepend>
  <b-input-group-prepend>
    <b-input-group-text
      >Gender</b-input-group-text
    >
  </b-input-group-prepend>
  <b-form-select
    class="form-control"
    placeholder="Gender"
    :options="getGendersForSelect"
    id="gender"
    v-model="$v.form.gender.$model"
    :state="chkState('gender')"
  ></b-form-select>
</b-input-group>
import { mapGetters, mapActions, mapMutations } from "vuex";
...
...mapGetters("genders", ["getGendersForSelect"]),
...
 ...mapActions("genders", ["loadGendersForSelect"]),

Bootstrap-Vue is loaded via main.js

import BootstrapVue from "bootstrap-vue";
Vue.use(BootstrapVue);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ndianabasicommented, Apr 15, 2020

So I added empty arrays to the options props as fallbacks and I think the form is still rendering well.

<b-form-select
                        class="form-control"
                        placeholder="Country of Organisation"
                        autocomplete="country"
                        @change="debouncedLoadCountriesState"
                        :options="getCountriesForSelect || []"
                        id="country_of_organisation"
                        v-model="$v.form.country_of_organisation.$model"
                        :state="chkState('country_of_organisation')"
                      ></b-form-select>

Thank you @tmorehouse.

1reaction
tmorehousecommented, Apr 15, 2020

Let us know how it goes…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Select | Components - BootstrapVue
Custom component using cross-browser custom styles. Optionally generate entries based on an array, array of objects.
Read more >
Bootstrap vue selecting the object from a list of objects b-form ...
You can bind the entire object to the value of an <option> tag. ... That way you'll get the entire object in the...
Read more >
v-model on b-form-select not working - CodePen
URL Extension Required. When linking another Pen as a resource, make sure you use a URL Extension of the type of code you...
Read more >
Vue-Multiselect | Vue Select Library
:hide-selected="true" – already selected options will not be displayed in the dropdown; :internal-search="false" – disables the multiselect's internal search ...
Read more >
Playground with form select in bootstrap-vue for vuejs - YouTube
When you working with form select inside bootstrap-vue you have the power to make it mor dynamic, but you can allways add your...
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