primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.06k stars 1.2k forks source link

Dropdown: Dropdown item can't be selected if the item value is falsey #5535

Open matthew-dean opened 6 months ago

matthew-dean commented 6 months ago

Describe the bug

I have an existing codebase where the list of options sets the default item to have an empty string value ''.

After migrating this to PrimeVue, I discovered that the first item could not be selected, nor would be selected by default.

Reproducer

https://stackblitz.com/edit/primevue-create-vue-typescript-issue-template-grxldp?file=src%2FApp.vue

PrimeVue version

3.47.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

Chrome Version 123.0.6312.59 (Official Build) (arm64)

Steps to reproduce the behavior

  1. Go to the Stackblitz
  2. Observe that the 'Default' item should be selected but it isn't.
  3. Observe that clicking to a different item and then back to the default still will not select it

Expected behavior

The first item should be selected (and selectable)

iwind commented 3 months ago

same issue in 4.0.0 rc series