Closed AlexanderZeilmann closed 2 months ago
Yep definitely looks like its missing.
I just noticed that there is selectedItemTemplate
which is called for each selected item: https://github.com/primefaces/primereact/blob/e433da4f24c965cfbb868435825139aeb54200d4/components/lib/multiselect/MultiSelect.js#L857-L871
Since this is not documented, the easiest fix would probably be to change the docs to
Available options and the selected options support templating with
itemTemplate
andselectedItemTemplate
properties respectively. In addition, header, footer and filter sections can be templated as well.
Maybe valueTemplate
could be used as template that is only called once for all selectedValues with the selectedItemTemplate
s as children
Thanks I am updating the Docs for selectedItemTemplate
Describe the bug
The MultiSelect template documentation mentions a
valueTemplate
property. However, it seems that it is not implemented forMultiSelect
(it is forDropdown
).See here for a demo: https://stackblitz.com/edit/vitejs-vite-hmrctz?file=src%2FApp.tsx
Reproducer
https://stackblitz.com/edit/vitejs-vite-hmrctz?file=src%2FApp.tsx
System Information
Steps to reproduce the behavior
valueTemplate
as mentioned in the MultiSelect docs.Expected behavior
MultiSelect should implement
valueTemplate
similar to the Dropdown component.