cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi @Anonymous :

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
eka24
Super User
Super User

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.

Anonymous
Not applicable

@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!

Hi @Anonymous :

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

Anonymous
Not applicable

Hey @v-bofeng-msft,

 

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

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,870)