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

Change of Dropdown selection throws error: Cannot read properties of undefined (reading 'length') primeng dropdown #14007

Closed
RupenAnjaria opened this issue Nov 2, 2023 · 8 comments · Fixed by #14022
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@RupenAnjaria
Copy link

Describe the bug

When a dropdown is changed the selection doesn't result any change and throws error in the console which reads as:

core.mjs:10592 ERROR TypeError: Cannot read properties of undefined (reading 'length')
at get inputClass [as inputClass] (primeng-dropdown.mjs:628:135)
at _class2_span_2_Template (primeng-dropdown.mjs:73:84)
at executeTemplate (core.mjs:11986:13)
at refreshView (core.mjs:13481:13)
at detectChangesInView (core.mjs:13646:9)
at detectChangesInEmbeddedViews (core.mjs:13589:13)
at refreshView (core.mjs:13505:9)
at detectChangesInView (core.mjs:13646:9)
at detectChangesInComponent (core.mjs:13621:5)
at detectChangesInChildComponents (core.mjs:13659:9)

Environment

Angular: 16.2.0
PrimeNG: 16.7.0
Browser: Chrome (Latest)

Reproducer

No response

Angular version

16.2.0

PrimeNG version

16.7.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.13.0

Browser(s)

Chrome

Steps to reproduce the behavior

Create a dropdown.
Prefill it's values.
Try changing it.

Expected behavior

No response

@RupenAnjaria RupenAnjaria added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 2, 2023
@RupenAnjaria RupenAnjaria changed the title Change of Dropdown throws error: Cannot read properties of undefined (reading 'length') primeng dropdown Change of Dropdown selection throws error: Cannot read properties of undefined (reading 'length') primeng dropdown Nov 2, 2023
@ibrahimkelly
Copy link

Also found it.

@Hambardzum93
Copy link

I also faced to this issue

@chillapp
Copy link

chillapp commented Nov 3, 2023

Me too

@benjaminknauer
Copy link

I also face the issue. Did you guys found a workaround yet?

It can be reproduced with a simple Dropdown like this. PLEASE fix or rollback immediately.

<p-dropdown
  [options]="[{ value: 'NY', label: 'New York' }]"
  optionValue="value"
  optionLabel="label"
></p-dropdown>

@adcore-dev
Copy link

I think it's a same issue:
#13996
All this happen after latest changes in 16.7.0

@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 Nov 3, 2023
@cetincakiroglu cetincakiroglu self-assigned this Nov 3, 2023
@cetincakiroglu cetincakiroglu added this to the 16.8.0 milestone Nov 3, 2023
@cetincakiroglu
Copy link
Contributor

Hello everyone,

With version 16.7.0, we have released the first part of the accessibility implementation for inputs that we have been working on for a long time. Based on the research we conducted during the implementation, we decided that many components needed changes in their structure and simplification, and these components were rewritten. Unfortunately, after extensive testing, there may be unexpected and unforeseen bugs that have emerged. We are grateful for your reports, and we are working to address them in the upcoming release!

@cetincakiroglu
Copy link
Contributor

Could you please share a stackblitz example of the case so we can identify and fix it?

@EnricoMessall
Copy link
Contributor

@cetincakiroglu See my merge request. That should fix it.

cetincakiroglu added a commit that referenced this issue Nov 4, 2023
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

Successfully merging a pull request may close this issue.

8 participants