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-autocomplete: optionLabel input has wrong type #14468

Closed
AndreasHae opened this issue Jan 3, 2024 · 1 comment · Fixed by #14486
Closed

p-autocomplete: optionLabel input has wrong type #14468

AndreasHae opened this issue Jan 3, 2024 · 1 comment · Fixed by #14486
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@AndreasHae
Copy link

Describe the bug

The documentation for optionLabel in p-autocomplete says:

Property name or getter function to use as the label of an option

But this is not apparent in the type, which is only string. If I want to pass a getter function, I have to use $any otherwise I get a compile error in the template.

Hence the type should be changed to string | (item: any) => string.

Environment

See versions below

Reproducer

No response

Angular version

17.0.6

PrimeNG version

17.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@AndreasHae AndreasHae 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 3, 2024
@SoyDiego
Copy link
Contributor

SoyDiego commented Jan 4, 2024

Hi @AndreasHae, I did a PR solving the problem. You can check it here: #14486.
Now we should wait PrimeNG Team approve it if they think the solution is OK for them.

@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 5, 2024
@cetincakiroglu cetincakiroglu added this to the 17.3.2 milestone Jan 10, 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

Successfully merging a pull request may close this issue.

4 participants