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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Focusing input one aft...
Power Apps
Unanswered

Focusing input one after another gets blurred because of onChange action

(0) ShareShare
ReportReport
Posted on by 6

Hello!

 

I have a PowerApps application page where I have multiple input controls one after another with some onChange" code and when you exit(blur) the first control by clicking on the next one, the cursor only stays there for a moment, then it blurs, you have to click the input again in order to be able to enter text.  (same thing if you want to proceed with 'Tab').
 
The onChange code has some UpdateContext on it, setting its value to a variable. I need it because the inputs are in a gallery placed as rows and I need to update the properties of the element in the row, and for some values other properties are recalculated as well.
 
Did anyone encounter this behavior? Any suggestions?
Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @tkantor :

    I'v made a test but did not encounted the problem you mentioned.

    t17.gif

    I suggest you change the device and test again.

    If the problem can not be solved, could you tell me more details about the app? For example:

    • What exactly are these input controls?
    • What are these input controls' OnSelect attribute? (Specific code)
    • Are these controls in a gallery?What are the specific settings?

    Best Regards,

    Bof

  • tkantor Profile Picture
    6 on at

    Having inputs: txtVal1, txtVal2, txtResult. Each has the 'default' set to the backing property from the colGallery element: value1, value2 and result

    Here is the onChange code for input txtVal1:

    UpdateIf(colGallery, uniqId = ThisItem.uniqId, {value1: If(!IsBlank(txtVal1.Text), Value(txtVal1.Text, "fr-FR"), Blank())});
    If(
     !IsBlank(ThisItem.value1) && !IsBlank(ThisItem.value2),
     UpdateIf(
     colGallery,
     uniqId = ThisItem.uniqId,
     { result: value1 * value2}
     ),
     UpdateIf(
     colGallery,
     uniqId = ThisItem.uniqId,
     { result: Blank()}
     )
    );

    Also I have input field outside the gallery with some onChange code that affects the colGallery and the same happens when I move focus from that input to one inside the gallery. Moving focus from gallery input to the one outside the gallery works fine - not blurred.

     

    Seems that the problem is that I alter the colGallery, and reloading the displayed values blurs the inputs

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @tkantor :

    I did the test according to your description and still did not reproduce the problem you mentioned.(The data source I use here is a collection)

    t18.gif

    Best Regards,

    Bof

  • tkantor Profile Picture
    6 on at

    In my page the layout is like this:

    tkantor_0-1594802593067.png

    You see the same fields are edited and calculated here, and after clicking and typing in Value1 you should click on input Value2 directly, not outside anywhere in the screen and then on the next input as you do in your example.

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @tkantor :

    Did you get blurred when you plan to edit the value2 of this item after editing the value1?
    My guess is the delay caused by the change in the data source.
    To verify this problem, I suggest that you can delete the OnChange proerty of these controls. Instead, add a button in the gallery to submit the update uniformly.

    Best Regards,

    Bof

  • tkantor Profile Picture
    6 on at

    Hi Bof, Thanks for the responsiveness.

    Yes, exactly it gets blurred when I plan to edit the value2 of this item after editing the value1.

    Clearly this does not occur if I remove the onChange code, also if I click and don't edit txtVal1 and then click on txtVal2 it stays focused.

    I'm sorry to hear there is no other solution, it was request to easily go through fields with the use of Tab key and edit each field in this way.

    All the best, Timea

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi I am also facing same issue. Did you get any solution for this? coz removing updatecontext code from onChange works like charm. But can't afford to remove that code.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard