Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown: editable prop requires optionLabel to be exactly "name" and options object to contain a "name" key #6076

Closed
artcab opened this issue Mar 3, 2024 · 3 comments
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Milestone

Comments

@artcab
Copy link

artcab commented Mar 3, 2024

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", in cities and optionLabel.
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 string

@artcab artcab added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 3, 2024
@kl-nevermore
Copy link
Contributor

same as #6004 ?

@melloware melloware added Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 4, 2024
@melloware melloware added this to the 10.5.2 milestone Mar 4, 2024
@melloware
Copy link
Member

Definitely looks like #6004 to me. @artcab can you confirm?

@artcab
Copy link
Author

artcab commented Mar 4, 2024

@melloware yes, confirmed.
Sorry.

@artcab artcab closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Projects
None yet
Development

No branches or pull requests

3 participants