Dropdown: editable
prop requires optionLabel to be exactly "name" and options object to contain a "name" key
#6076
Labels
Resolution: Duplicate
Issue has already been reported or a pull request related to same issue has already been submitted
Milestone
Describe the bug
when the
editable
prop is present in a Dropdown, but the optionLabel is not equal to "name", or when it is not present, the content can't be edited in freefrom.Also, there are these console error logs:
uncaught TypeError: Cannot read properties of undefined (reading 'toLocaleLowerCase')
-- something in the source seems to be hardcoded to "name" instead of the value of
optionLabel
Reproducer
https://stackblitz.com/edit/9feplu?file=src%2FApp.jsx
PrimeReact version
10.5.1
React version
18.x
Language
ALL
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
from stackblitz reproducer, the Dropdown editable example has been modified:
name
has been renamed "cityName", incities
andoptionLabel
.attempt to edit the Dropdown value in freefrom.
The value will fallback to whatever was selected instead.
if the object contained a "name" key and if optionLabel were "name", it'd work.
Expected behavior
the object key and
optionLabel
should be able to be any stringThe text was updated successfully, but these errors were encountered: