cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

How to unfocus selected record in gallery?

Hey everybody,

Just go a little question and it should be quite easy to answer.

 

If I click a record in the gallery, then it'll be focused.

But how to disable the focus of the record again if I click on the record of the gallery?

 

Thanks so much for helping!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to unfocus selected record in gallery?

Hi @ThePowerAppsGuy :

Only need to set two variables to achieve this function.I've made a test for your reference:

1\Set the Gallery's OnSelect property to :

 

Set(var,!var);Set(default,ThisItem);Reset(Gallery1) /*var and default is my variables*/

 

2\Set the Gallery's Default property to :

 

If(var,{},default)

 

37.gif

Best Regards,

Bof

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: How to unfocus selected record in gallery?

Can you show a screenshot

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted
Resolver II
Resolver II

Re: How to unfocus selected record in gallery?

@eka24,

 

If I don't want a default item selected on the gallery, I can set the default property to {}.

Then the gallery has no focus by default. But if I click the gallery again, then it'll focus again. That's what I like.

 

But what I'd like to achieve is, if I click again, then the item should not be selected again (no focus).

I've tried following for the Gallery:

OnSelect              {}

OnSelect              SetFocus(Label)

 

But there's no chance to disable the selection for the Gallery.

 

Does anyone know how to achieve it?

 

Thanks so much for helping!

Highlighted
Community Support
Community Support

Re: How to unfocus selected record in gallery?

Hi @ThePowerAppsGuy :

Only need to set two variables to achieve this function.I've made a test for your reference:

1\Set the Gallery's OnSelect property to :

 

Set(var,!var);Set(default,ThisItem);Reset(Gallery1) /*var and default is my variables*/

 

2\Set the Gallery's Default property to :

 

If(var,{},default)

 

37.gif

Best Regards,

Bof

View solution in original post

Highlighted
Resolver II
Resolver II

Re: How to unfocus selected record in gallery?

Hey @v-bofeng-msft,

 

Thanks for your help 😀. It's working...

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,294)