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

p-dropdown: optionValue is not working when object has property 'group' #14516

Closed
kiknadze opened this issue Jan 9, 2024 · 4 comments
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@kiknadze
Copy link

kiknadze commented Jan 9, 2024

Describe the bug

I performed a version migration from PrimeNG 14 to 16.9.1, and immediately the dropdowns that receive an object but have their value and label specified stopped working. The options are not displayed in the HTML.

As I investigated problem is 'group' property of object. If group is undefined it works properly, but if group has any value then it shows empty list.

<p-dropdown
      [options]="templates"
      inputId="templateId"
      placeholder="Select Template"
      optionLabel="name"
      optionValue="id"
      formControlName="templateId">
</p-dropdown>

12

295270663-2769ac3b-df07-4e52-b57b-a424c3be778b

image

Environment

"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.12",
"@angular/common": "^16.2.12",
"@angular/compiler": "^16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",
"@angular/service-worker": "^16.2.12",
"ngx-bootstrap": "^11.0.2",
"bootstrap": "^5.2.0",
"font-awesome": "^4.7.0",
"@fortawesome/angular-fontawesome": "^0.13.0",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-regular-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"primeicons": "^5.0.0",
"primeng": "^16.9.1",
"rxjs": "~6.6.3",
"zone.js": "^0.13.3"

Reproducer

No response

Angular version

16.2

PrimeNG version

16.9.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.1

Browser(s)

Chrome

Steps to reproduce the behavior

No response

Expected behavior

No response

@kiknadze kiknadze added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 9, 2024
@mehmetcetin01140 mehmetcetin01140 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 11, 2024
@mertsincan
Copy link
Member

Thanks a lot for your report! Could you please attach a stackblitz link for us to replicate? I added a milestone. If you attach a link, we'll fix it before the milestone is released.

@mertsincan mertsincan added this to the 17.4.0 milestone Jan 16, 2024
@kiknadze
Copy link
Author

@tsinevik
Copy link
Contributor

Hi, this is because dropdown has incorrect logic for choosing a template for option. It renders group template if option object has group property.
I have a PR opened (#14382) with fix for this issue for quite some time already. Would really appreciate if you push a fix for it as quick as possible.

@cetincakiroglu cetincakiroglu self-assigned this Jan 23, 2024
@cetincakiroglu
Copy link
Contributor

fixed in #14382

@cetincakiroglu cetincakiroglu removed their assignment Jan 24, 2024
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

5 participants