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: Null / Undefined options causes editable to throw an error. #6796

Closed
PuppetFoam opened this issue Jun 26, 2024 · 0 comments · Fixed by #6797 or leoo1992/GeradorQRCode#57 · May be fixed by nhattpn/BTL_LTNC#56
Closed

Dropdown: Null / Undefined options causes editable to throw an error. #6796

PuppetFoam opened this issue Jun 26, 2024 · 0 comments · Fixed by #6797 or leoo1992/GeradorQRCode#57 · May be fixed by nhattpn/BTL_LTNC#56
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@PuppetFoam
Copy link
Contributor

Describe the bug

Because options is an optional prop, if the options are undefined and you try to use the editable prop, an "Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')" error is thrown when typing in the Dropdown.

Reproducer

https://codesandbox.io/s/primereact-forked-rjx5p7?file=/src/App.jsx

PrimeReact version

10.6.6

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Ensure that options is either not included as a prop, or pass undefined as options.
  2. Ensure that editable is set to true.
  3. Type in the Dropdown and observe the "Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')" error in the console, as well as the input being cleared when trying to save the input.

Expected behavior

No error should be thrown, and the input should be saved when you leave the Dropdown.

@PuppetFoam PuppetFoam added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 26, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 26, 2024
@melloware melloware added this to the 10.7.0 milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment