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: Missing optionLabel property causes error #6518

Closed
ewenjo opened this issue Apr 30, 2024 · 3 comments · Fixed by #6520, leoo1992/GeradorQRCode#27, leoo1992/GeradorQRCode#40 or mtech-31-quemistry/quemistry_client_web#3
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@ewenjo
Copy link
Contributor

ewenjo commented Apr 30, 2024

Describe the bug

When creating a Dropdown comp without the optionLabel property, opening the dropdown causes the page to error. When in the past it would properly default to "label".

This is especially a problem with RowsPerPageDropdown in Paginator where you cannot simply add that prop.

Reproducer

https://stackblitz.com/edit/vitejs-vite-sswemw?file=src%2FApp.tsx

PrimeReact version

10.6.4

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a Dropdown
  2. Don't set the optionLabel prop
  3. Click dropdown

Expected behavior

Not setting the optionLabel property should default to using "label".

@ewenjo ewenjo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 30, 2024
This was referenced Apr 30, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 30, 2024

PR submitted.

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 30, 2024
@ewenjo
Copy link
Contributor Author

ewenjo commented Apr 30, 2024

It's the same case for optionValue as well. Omitting it causes the value to be wrong

@Rekl0w
Copy link
Contributor

Rekl0w commented May 1, 2024

I tried it after PR, it works now. There is no need to make changes for optionValue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment