-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Autocomplete: selectedItem template only works if multiple="true" #12983
Comments
Yeah selected item only work in multiple mode... In single mode the input is field with the selected field |
Duplicates #2242 (opened in 2017) and #10360 (2021), but these issues were somehow closed. |
This is very important to my project, and it is heartbreaking to see this has been ignored and closed out many times. |
You can use
|
@bluesbroz This is the workaround that I am using. I do not like that it requires an additional property or class method to display something that should and could be defined in the template. |
At this point I am now using item templating and toString on my classes since it works well. |
Hi all, For now selectedItem template is only supported in multiple mode. I've updated the issue title and added it into 17.Future milestone. We'll add selectedItem support for single mode in the future. |
v.17 still not working. |
So, is it still planned for v17 or v18? |
Describe the bug
According to the documentation, there should be a
selectedItem
-Template, that is used for displaying the selected object from an autocomplete input. Currently this template is ignored and instead the [field]-attribute is used. This does not allow to specify a complex template when thesuggestions
are complex objects.This issue has also been reported in #2242
@mertsincan said a new ticket should be opened if the issue still persists.
Environment
Current version of angular and primeng, happening in all browsers.
Reproducer
https://github-cnxtrn.stackblitz.io
Angular version
15.2.8
PrimeNG version
15.4.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.16.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
When the selectedItem is specified it should be used instead of the field-attribute.
The text was updated successfully, but these errors were encountered: