web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SetFocus to a CodeComp...
Power Apps
Unanswered

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!

I have the same question (0)
  • Verified answer
    cchannon Profile Picture
    4,702 Moderator on at

    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.

  • thmwg Profile Picture
    20 on at

    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

  • thmwg Profile Picture
    20 on at

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard