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: Binding to type no longer works (regression) #14089

Closed
pkdigital opened this issue Nov 11, 2023 · 1 comment
Closed

Dropdown: Binding to type no longer works (regression) #14089

pkdigital opened this issue Nov 11, 2023 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@pkdigital
Copy link

Describe the bug

When binding an array of a data to the p-dropdown control and that data value field is a typescript type the control is unable to display the corresponding name member.

Environment

Primeng 16.7.2
Angular 16.2.0

Reproducer

https://stackblitz.com/edit/bpr5uy-vq3hq7?file=src%2Fapp%2Fdemo%2Fdropdown-basic-demo.html

Angular version

16.2.0

PrimeNG version

16.7.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18

Browser(s)

Any

Steps to reproduce the behavior

Control markup

<p-dropdown
    [options]="cities"
    [(ngModel)]="selectedCityCode"
    optionLabel="name"
    optionValue="code"
    showClear="true"
    placeholder="Select a City"
  ></p-dropdown>

Type definition

type CityCode = 'NY' | 'LDN' | 'RM' | 'IST' | 'PRS';

Bound values

cities: { name: string; code: CityCode }[] = [
        { name: 'New York', code: 'NY' },
        { name: 'Rome', code: 'RM' },
        { name: 'London', code: 'LDN' },
        { name: 'Istanbul', code: 'IST' },
        { name: 'Paris', code: 'PRS' }        
    ];

Output:

image

Expected behavior

No response

@pkdigital pkdigital 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 11, 2023
@pkdigital
Copy link
Author

Sorry, just realised this is a dupe of #14054

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant