Component: Autocomplete
Describe the bug
I am upgrading to angular 16 from angular 12 and now I can not find the method focusInput() were did it go? is there another way to put a focus in the input field programmatically?
note that this api exists in primeng version 16.0.0
Environment
angular 16 prime version 16.9.1
Reproducer
No response
Angular version
16.0.0
PrimeNG version
16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.10.0
Browser(s)
chrome
Steps to reproduce the behavior
the method was there but now it is not. just look at the code
Expected behavior
to be able to set focus on the input control of the autocomplete programatically
Seems, it's removed.
You can find element from DOM and focus manually.
what is the best way to do it, which selector should I use to find the input element?, can I inject it with @viewchild or something like this.
You can access the AutoComplete component and use this viewChild property below.
https://github.com/primefaces/primeng/blob/3d5b78ecac68e3b0bb3ef4417c9fc2be3a3fd19d/src/app/components/autocomplete/autocomplete.ts#L688
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?
Thanks a lot for your understanding! Best Regards,