Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component: Autocomplete #15642

Closed
urielTwito opened this issue May 21, 2024 · 4 comments
Closed

Component: Autocomplete #15642

urielTwito opened this issue May 21, 2024 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@urielTwito
Copy link

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 urielTwito added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 21, 2024
@Sinan997
Copy link
Contributor

Seems, it's removed.

You can find element from DOM and focus manually.

@urielTwito
Copy link
Author

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.

@Sinan997
Copy link
Contributor

You can access the AutoComplete component and use this viewChild property below.

@ViewChild('focusInput') inputEL: Nullable<ElementRef>;

@mertsincan
Copy link
Member

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants