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

Component: Dropdown TypeError: option.toLowerCase is not a function (PringNG 17.0 + 17.1) #14370

Closed
rburgst opened this issue Dec 14, 2023 · 7 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@rburgst
Copy link

rburgst commented Dec 14, 2023

Describe the bug

Ever since upgrading to primeng 17.x the dropdown is broken, at the very least when using it with a form control.
Might be related to #14241

Environment

Mac OSX, Chrome

Reproducer

https://stackblitz.com/edit/hhk8ms?file=src%2Fapp%2Fdemo%2Fdropdown-reactive-forms-demo.html

Angular version

17.0.5

PrimeNG version

17.1.0

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

Chrome

Steps to reproduce the behavior

  1. open the dropdown
  2. enter something in the filter box

Expected behavior

it should work

@rburgst rburgst added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 14, 2023
@urielzen
Copy link

I have the same issue

@urielzen
Copy link

possible duplicate of:

#14311

@rburgst
Copy link
Author

rburgst commented Dec 15, 2023

setting the filterBy seems to improve the situation just as described in #14311 . I am still experiencing a variant of #14241 where the selected element is not showing up (in a form array).

@yassine-fy94
Copy link

Also the filterBy option is not working

@Orion151-C
Copy link

It works for me, i forked your stackblitz https://stackblitz.com/edit/hhk8ms-gucjhk?file=src%2Fapp%2Fdemo%2Fdropdown-reactive-forms-demo.html and it works, only added "filterBy"

@cetincakiroglu cetincakiroglu added this to the 17.3.2 milestone Jan 8, 2024
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 10, 2024
@CyleClone
Copy link

CyleClone commented Jan 29, 2024

I've updated my project to 17.4.0 and the filter still throws the same error.
Error appears to happen when you keep the standard setting of reading label.

image

As others have mentioned adding filterBy would solve the issue. Alternatively setting optionLabel="label" would also solve it.
But changing attributes for more than 100+ dropdowns isn't really viable.

Additionally the Dropdown loses it's chosen value while filtering.
Forked original Stack to update PrimeNG package and show the last point:
https://stackblitz.com/edit/hhk8ms-8g5ykm?file=src%2Fapp%2Fdemo%2Fdropdown-reactive-forms-demo.html

@Reflection281
Copy link

I must agree, I have the same problem with the same version. The bug of losing its selected value when filtering is really weird. It loses the value when typing, but it reappears when you delete the typed characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

8 participants