Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Issue with the Text Input (Modern Control) in Canvas Apps

(3) ShareShare
ReportReport
Posted on by 2,047
Hi Team,
 
We've observed that the new "Text Input" control in canvas apps or custom pages doesn't support the "OnSelect" property, which was previously available in the classic "Text Box" control.
 
While the modern control does include the "OnChange" property, but our requirement is to trigger logic as soon as the user clicks or focuses on the text box.
 
Is there any way to replicate this behavior in the modern control, similar to how the "OnSelect" event worked in the classic control?
 
Any kind of help would be greatly appreciated.
 
Thank you
Categories:
  • Suggested answer
    Inogic Profile Picture
    472 on at
    Issue with the Text Input (Modern Control) in Canvas Apps
    Hi,
     
    There are a few creative workarounds you can use to replicate “OnSelect” or “OnFocus” behavior in modern Text Input controls. Follow the below steps.

    1. Add a Timer control
    • Set Duration to something small, like 10
    • Set Repeat to false
    • Set AutoStart to false
    • Set Visible to false (optional)

    2. Add a variable to detect focus
    • In your screen's OnVisible, initialize:
                   
    Set(varFocused, false); Set(varShowOverlay, true)
    3. Add a transparent Rectangle over the Text Input
    • Drag the Rectangle to cover the Text Input exactly (or slightly larger if needed).
    • Resize it to match the size of Text Input.
    • This will simulate OnSelect
    • Set Fill to RGBA(0, 0, 0, 0), Visible to varShowOverlay, BorderThickness to 0, and ensure it's on top of the Text Input
    • Right-click the rectangle Reorder Bring to Front
                  4. OnSelect of this Rectangle:
          Set(varFocused, true); Timer1.Start=true; Set(varShowOverlay, false);

                 5. In Timer1.OnTimerEnd:
          SetFocus(Text Input)

    Now you're programmatically focusing the input and can add any logic in OnSelect property of Rectangle.

    Hope this helps.
     
    Thanks!
    Inogic
  • Suggested answer
    Holly Huffman Profile Picture
    5,917 on at
    Issue with the Text Input (Modern Control) in Canvas Apps
    Good morning, afternoon, or evening depending on your location!
     
    The modern "Text Input" control in Power Apps does not support the "OnSelect" property, as you've noted. However, you can replicate similar behavior using alternative approaches.
    1. Use the OnChange Property:
    • While it doesn't trigger logic on focus or click, you can use the OnChange property to execute actions when the user modifies the text. This is the closest built-in functionality available.
    2. Overlay a Transparent Button:
    • Place a transparent button over the text input control. Set the button's OnSelect property to trigger your desired logic. When the user clicks the text box, they'll actually be interacting with the button.
    3. Focus Detection with Timer Control:
    • Use a timer control to detect when the text input gains focus. Combine this with the FocusedBorderColor property to visually indicate focus and trigger logic indirectly.
    4. Custom Component:
    • Create a custom component that combines the modern text input control with additional functionality, such as focus detection or click events.
     
    Hope this is helpful :)

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans