How to autofocus autocomplete onmount?

1 Answer 53 Views
AutoComplete
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Wreeecks asked on 24 Jan 2022, 03:54 AM

Is there a way to focus the autocomplete inputbox on pageload?

Input has "autofocus" props, is there anything for autocomplete? thanks!

1 Answer, 1 is accepted

Sort by
1
Accepted
Stefan
Telerik team
answered on 24 Jan 2022, 07:03 AM

Hello,

That can be done using the component ref and focusing it programmatically when the component mounts:

https://stackblitz.com/edit/react-ozjbci-ss7jce?file=app/main.jsx

I hope that is helpful.

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
commented on 02 Feb 2022, 11:16 PM

you're a star, stefan!
Tags
AutoComplete
Asked by
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Stefan
Telerik team
Share this question
or