primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Component: Autocomplete

Open urielTwito opened this issue 1 year ago • 3 comments

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

urielTwito avatar May 21 '24 13:05 urielTwito

Seems, it's removed.

You can find element from DOM and focus manually.

Sinan997 avatar May 21 '24 14:05 Sinan997

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.

urielTwito avatar May 22 '24 02:05 urielTwito

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

Sinan997 avatar May 22 '24 07:05 Sinan997

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,

mertsincan avatar Dec 16 '24 12:12 mertsincan