Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

SetFocus to a CodeComponent

(0) ShareShare
ReportReport
Posted on by 4

Hello everybody,

 

I have a question and maybe someone can help me. Because there is no possibility to hide the virtual keyboard on a mobile device if a textbox gets the focus, I implemented a inputfield as a code component, where the keyboard is hidden when the user clicks in the textinputfield.

But I need the possibility to set the focus to that code component (textfield) automatically.

This is currently not working.

Any ideas, any support is highly welcome.

 

BR Thomas

P.S. if someone has an idea how to hide the virtual keyboard on tablets or mobilphone, highly appreciated!

  • thmwg Profile Picture
    20 on at
    Re: SetFocus to a CodeComponent

    Thanks for your hint; i could solve my issues with your proposal

  • thmwg Profile Picture
    20 on at
    Re: SetFocus to a CodeComponent

    Hi cchannon,

    thanks for your feedback. I´m not really familiar with programming typescript and code components, but I think I understood your proposal and I will check. Maybe it is ok, if I come back to you, if I have any further problems 😉

    Thanks!

    BR Thomas

  • Verified answer
    cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: SetFocus to a CodeComponent

    I would create a boolean input value in the codecomponent - hasFocus. When you want to programmatically set focus to your control from in the app, just change hasFocus to True, then in your code component you will get a refresh of the inputs. If hasFocus == true, then setFocus with your Js/Ts/React/whatever you're using.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 55 Super User 2025 Season 1

Overall leaderboard