Add MatAutocompleteTrigger to DynamicMaterialInputComponent
ironbirdie opened this issue · 0 comments
I'm submitting a
[ ] Bug / Regression
[*] Feature Request / Proposal
I'm using
NG Dynamic Forms Version: `X.Y.Z`
[ ] Basic UI
[ ] Bootstrap UI
[ ] Foundation UI
[ ] Ionic UI
[ ] Kendo UI
[*] Material
[ ] NG Bootstrap
[ ] Prime NG
Description
I have several autocomplete input fields in my form. But i would like to be able to be able to close the panel programmatically.
When i set the focus to another fields programmatically. The autocomplete-panel doesn't close.
In the material documentation is stated that to do this you need to use the MatAutocompleteTrigger, but I'm unable to get a reference to it. I can however find a reference to the MatAutocomplete itself. But the trigger isn't exposed.
In the code i've found this way to get to my component:
this.componentService.getFormControlRef('fieldID').instance.matAutocomplete);
In DynamicMaterialInputComponent i find following line:
@ViewChild("matAutocomplete", {static: true}) matAutocomplete: MatAutocomplete;
But I think to achieve this, another line should be added, something like this.
@ViewChild('autoCompleteInput', { read: MatAutocompleteTrigger }) autoComplete: MatAutocompleteTrigger
Would this be possible, or is there another way to achieve closing the autocomplete-panel programmatically.
Thanks in advance,
Bart