primefaces / primereact

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

Dropdown: optionValue returns null when select an item from keyboard #6803

Closed ws-ksda closed 1 month ago

ws-ksda commented 3 months ago

Describe the bug

With optionValue property the item selected from keyboard does not appear on dropdown label, the onChange returns null.

Reproducer

https://stackblitz.com/edit/1yfam4?file=src%2FApp.tsx

PrimeReact version

latest

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

https://github.com/primefaces/primereact/assets/101215299/29d0c9e8-ace0-4941-bc47-3d1d9d7a5238

Expected behavior

On Primereact 10.3.1 it works.

sja-cslab commented 3 months ago

As info - if you rename .code to .value and remove that optionValue="code" it will work. In case you need an asap fix.

We got this already at #6316

melloware commented 3 months ago

This was fixed in 10.6.4 and 10.6.6. is the latest? @ws-ksda can you confirm?

ws-ksda commented 3 months ago

Yes, it is latest. Look package.json stackblitz:

https://stackblitz.com/edit/1yfam4?file=src%2FApp.tsx,package.json