primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Multiselect does not show labels of selected items when values are bound to a reactive form control

Open JulianRuhrDev opened this issue 7 years ago • 1 comments

If you have a PrimeNG PRO Support subscription please post your issue at;

https://pro.primefaces.org

where our team will respond within 4 business hours.

If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.

Current Waiting Time: ~8 weeks.

I'm submitting a ... (check one with "x")

[ x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/github/primefaces/primeng-issue-template

Current behavior Currently I load my options from the server using an observable and setting the options during the subscription.

The problem is that the multiselect does not show the selected labels of the current form input and also does not check the selected entries. When listening to the submit of the form I checked the multiselect value property which contains the entries. The problem looks to be related to a wrong binding. However when the maximum number of values to show is exceeded the default text x items Selected is shown.

Expected behavior

The expectation is that the labels of my current selection items is shown when feeding the form control with my values from the current selected user.

Minimal reproduction of the problem with instructions

  1. Create a reactive form and use the multiselection as a form control
  2. Fetch the initial options from the server and bind them to the multiselect tag
  3. Fetch the current selected items from the server and update your form

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

OS: MacOS Mojave Angular: Angular 7.1 PrimeNG: v7.1

  • Angular version: 5.X
  • PrimeNG version: 5.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

JulianRuhrDev avatar Feb 21 '19 10:02 JulianRuhrDev

Issue has been resolved due to implementation failure. Sorry for bothering.

JulianRuhrDev avatar Feb 21 '19 13:02 JulianRuhrDev