cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Iantaylor2050
Helper V
Helper V

SetFocus/LoseFocus available in powerapps ?

Hi All,

 

I have a datacard which has a single line of Text field in my Powerapps newform named Country. When user clicks inside that textarea and key-in, autocomplete gallery shows below the textfield, which includes some suggestions for Country.

 

However, once user clicks outside that text area, I need to hide that autocomplete gallery. Any idea how to achieve this in powerapps ?

 

Is there any SetFocus (or) LoseFocus to achieve this in Powerapps ?

 

 

4 REPLIES 4

@Iantaylor2050 

 

Not supported. It may be possible with some sort of workaround (we are not sure what to suggest in your case though) - but it is not supported directly.

 

OnSelect can be used to approximate OnFocus currently.

 

There is no OnBlur or equivalent in Power Apps that we know of.

 

Can consider to upvote this idea here for consideration for future release:

 

Add OnBlur Event Support 


Hi @poweractivate 

 

Ok. In onselect, I can make my autocomplete gallery visible. However, Once i click outside that textbox, the autocomplete gallery should be hidden. I can't use OnSelect here right ?

@Iantaylor2050 

 

The only thing that faintly comes to mind is putting a giant empty control that spans the whole screen and positioning it behind the Textbox Control, and in the OnSelect of that giant Control, do what you would rather do in an OnBlur of the actual  Textbox Control, to compensate for the fact that there is no OnBlur. This was the line of thinking we meant about "may be possible with some sort of workaround." You would want to position the giant Control carefully - position it behind the textbox, but also position it in front of any other Controls that still need to take input - and those controls when in front when clicked OnSelect need to have those formulas to also hide the textbox in that case (then anything else it needs to do) if these other controls end up being possible to click during this autocomplete operation. We can not think of anything else.

 

There may be yet another sort of workaround way like the above - another member on this forum is welcome to suggest any one or more ways we might have overlooked, but we cannot think of anything else other than the above.

This answer really works for me to control a lose focus in my textbox.

Using a giant box transparent and only have to move it to front when user clicks on textbox, but when user clicks on giant box,  I only have to reset textbox and move the giant box to back.  really thank you

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,625)