Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectMenu error when pass false value #1544

Closed
carlosvaldesweb opened this issue Mar 20, 2024 · 0 comments · Fixed by #1550
Closed

SelectMenu error when pass false value #1544

carlosvaldesweb opened this issue Mar 20, 2024 · 0 comments · Fixed by #1550
Labels
bug Something isn't working

Comments

@carlosvaldesweb
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v20.9.0
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.0
  • Nitro Version: 2.9.4
  • Package Manager: npm@10.1.0
  • Builder: -
  • User Config: css, extends, modules, stripe, eslint, image, runtimeConfig, imports, ui, devtools, experimental
  • Runtime Modules: @nuxt/ui@2.14.2, @nuxt/image@1.4.0, @nuxtjs/eslint-module@4.1.0, @vueuse/motion/nuxt@2.1.0, nuxt-clarity-analytics@0.0.6, dayjs-nuxt@2.1.9, @unlok-co/nuxt-stripe@2.0.0, @nuxtjs/i18n@8.2.0
  • Build Modules: -

Version

"@nuxt/ui": "^2.14.2",

Reproduction

<script setup lang="ts">
const numberAnswersOptions = computed(() => {
  const options = [
    {
      label: "Solo 1 respuesta correcta",
      value: false,
    },
  ];
  if (props.question.question_type.supports_multiple_answers) {
    options.push({
      label: "Varias respuestas correctas",
      value: true,
    });
  }

  return options;
});
</script>
<UFormGroup label="Número de respuestas" name="allows_multiple_answers">
      <USelectMenu
        v-if="question"
        v-model="state.allows_multiple_answers"
        option-attribute="label"
        value-attribute="value"
        :options="numberAnswersOptions"
        @change="form.submit()"
      />
    </UFormGroup>

Description

When i use false as value from USelectMenu i'm getting, and i cannot bind the value because USelectMenu is blank.
Captura de pantalla 2024-03-20 a la(s) 12 15 09 p m

Vue warn]: Invalid prop: type check failed for prop "modelValue". Expected String | Number | Object | Array, got Boolean with value false. 
  at <SelectMenu key=0 modelValue=false onUpdate:modelValue=fn  ... > 

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant