primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.58k stars 990 forks source link

DropDown optionValue not working anymore #6892

Closed viktorjordan87 closed 1 month ago

viktorjordan87 commented 1 month ago

Describe the bug

Hello guys,

Bug: The dropdown component when has an array of objects as options, the optionValue string not works anymore. So all my webapplication start to die if my ci pipeline updates the node_modules of primereact.

In the documentation is said: If optionValue is omitted and the object has no value property, the object itself becomes the value of an option.

But my optionValue is set, and instead of retrieving the value of the object key, I got back the whole object.

Reproducer

https://stackblitz.com/edit/7jtspm?file=src%2FApp.jsx

PrimeReact version

10.7.0

React version

18.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Use the optionValue in a Dropdown and you value will be an object instead of a string as it should be.

Expected behavior

If I have the optionValue set, I need to get back the value of the object key as it before.

melloware commented 1 month ago

Duplicate fixed for 10.7.1: https://github.com/primefaces/primereact/issues/6827