primefaces / primevue

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

MultiSelect: currently selected values showing as "null" while "loading #4162

Open dipbhi opened 1 year ago

dipbhi commented 1 year ago

Describe the bug

When a simple MultiSelect (no custom slot content) has selected (v-model) values available before the options values while :loading="true", selected values are displayed as null.

Reproducer

https://codesandbox.io/s/funny-carson-5yn7vy?file=/src/MultiSelectFilterIssue.vue

PrimeVue version

3.30.1

Vue version

3.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the reproducer link
  2. It will show the selected values as null, null when options are not loaded yet, even when :loading is true.

Expected behavior

It should show the placeholder when when :loading is true.

johnknapp commented 6 months ago

Any progress here? We've got a similar issue. Currently selected values appear as null on page load.

dmitriyermolin commented 2 months ago

Any progress here? We've got a similar issue. Currently selected values appear as null on page load.

Try to set "dataKey" property instead of "optionValue", it helped me to resolve the issue.

Tamas-hi commented 1 month ago

Any progress here? We've got a similar issue. Currently selected values appear as null on page load.

Try to set "dataKey" property instead of "optionValue", it helped me to resolve the issue.

Thanks for this solution! In my case I am not loading anything, still the value was null. Adding data-key solved the problem.