I am working on a reactive form that uses the combobox component as an autocomplete to dynamically search for the values that the user is typing into it. We need to use the combobox instead of the actual autocomplete component because we need the value to be the entire underlying object that the user selects.
This form also needs to pre-populate some data given to the component. I accomplish this using FormArrays/FormGroups and binding the combobox component to the value of the form control via the formControlName attribute. The problem I run into though is that when the combobox is bound to the formControl values, the text in the field that is bound to textField is not displayed.
My understanding is that since the objects I'm initializing the form with are not in the data list (i.e. my search results) they won't be displayed. I'd rather like to avoid merging the two lists together as that destroys the separation of concerns between something dynamic (the search results) and the static initial values. I'd also like to not have those initial values pop up as search results since they are already in the form.
I've created a stackblitz that demonstrates my problem. https://stackblitz.com/edit/angular-cyaiax You can see by looking in the console that the initial form state is valid and pre-populated with the values supplied but they aren't displayed. Additionally if you "search" by typing in a combobox and selecting a value it will update the form appropriately and display the text.
Is there a way to make the combobox display the pre-populated values of the formControl it's bound to?