bullhorn / novo-elements

UI Repository for Bullhorn's Novo Theme
http://bullhorn.github.io/novo-elements
MIT License
76 stars 61 forks source link

[Pickers] cannot set multi picker value correctly #1012

Open johnsully83 opened 5 years ago

johnsully83 commented 5 years ago

When rendering a multi-picker, if you attempt to set the value of the picker via any of the normal methods, e.g.

  1. FieldInteractionAPI.setValue('field', array)
  2. NovoFormGroup.patchValue({ 'field': array })

The UI renders '[object Object]' for each of the elements in the array, regardless of whether the array consists of label/value pair object, or arbitrary JSON object with a format parameter. Tried all combinations of 'format', 'labelFormat', 'id', and various properties on the objects within the Array, including label/value.

adrianossi commented 5 years ago

Is this only a rendering issue, or does it affect the form's value as well? I.e., if you save the form, does it persist or not?

fayranne commented 5 years ago

We're pretty sure it's only a rendering issue, however we never tested fully saving the form due to the UI bug.

JoshNewbury commented 4 years ago

Are there any updates? I believe I am experiencing the same exact issue. I am seeing that using API.setValue or patchValue on an internal picker works (form saves the value) when passing the id, but displays nothing in the form field. If you pass the entire object it will display the user correctly but will not save.

MohamedMahmoud299 commented 4 years ago

It worked when I just had a simple array of strings and the form actually saves an array of strings not string, id pairs