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 / Invisible Button insid...
Power Apps
Answered

Invisible Button inside Gallery is clickable

(0) ShareShare
ReportReport
Posted on by 39

Hello Powerappers,

 

this is a quick question.

I have a simple (horizontal) Gallery with one Button. This Gallery serves as a Tab control experience and based on the button click it displays data in the Container control. This works well.

The source for the Gallery is a simple Table with two columns ID and TabText. There is 8 records in the Table.

Then I have an Edit and Cancel Icon outside of the Gallery, where I just switch between edit and view mode.

When I make the click and change the mode to Edit I need the last button in the Gallery to be hidden / invisible because I don't want a user to switch to that Tab. This is also done.

But I've just found out (accidentally) that even the button is not visible I can make a click/select event. This is what I cannot understand why is this possible. 

I've also tried to make it disabled instead of invisible. But again, even the control is in disabled mode, I am able to select it.

Is this normal behaviour? Would you have some idea?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @syd

    It is probably the OnSelect property of the gallery rather than the button. 

  • syd Profile Picture
    39 on at

    Hi Drrickryp,

    thanks for response.

    This is the Gallery button Visible property: 

     

     

    ThisItem.TabName <> "Info Tab" Or gblProjectFormMode = "view" Or gblNewProjectSubmitted

     

     

    The Gallery OnSelect is just: false.

     

    If I understand right you're suggesting I should focus on the Gallery OnSelect. So, the logic should happen there somehow? I will try it.

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Look around in that Gallery Template area. Seems like you might have another control in there that might have an OnSelect. If it's not visable it shouldn't be interactable. 

  • syd Profile Picture
    39 on at

    @cwebb365, there is only one button in the Gallery.

    syd_0-1674060823560.png

    The following screen is the Visible property of the Container below the Gallery (I have eight of them for each Tab):

    galProjectTab.Selected.btnProjectTabSection.Text = "Info Tab"

    In the OnSelect of the btnProjectTabSection I've set a local variable to indicate which Tab ID is  the selected one:

    UpdateContext({locActiveTab: ThisItem.ID})

     When I click around the Tabs I see locActiveTab changing. When I click the the area where the last (eigth) Tab is located but hidden, then the locActiveTab is not updated meaning the last button is not pressed. But as this row is selected then the above mentioned Container is showed anyway as the fx result is true.

    So, I have modified the fx with And condition:

    galProjectTab.Selected.btnProjectTabSection.Text = "Info Tab" And locActiveTab = 8

    Not perfect, but at least the Container content of Info Tab is not shown.

    Been long day, I need a rest. I'll be playing with it later. In the meantime, many thanks for your input.

     

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Odd, so does the tab(Button) actually still show up visually? In my testing it's completely gone. If it's still showing up, wondering if your OR statements are keeping it showing and maybe you have some IF statements changing your Text to blank on the button? 

     

  • syd Profile Picture
    39 on at

    Agree, it's odd. No, the button is hidden. So, I see only 7 buttons but when I click on the empty spot next to the 7th button, where the last hidden button would supposed to be, the Gallery row or actually a collumn, as it is a horizontal Gallery, become selected.

    Therefore, when I check: 

    galProjectTab.Selected.TabName

    the result is 'Info Tab'. And that's the reason I could see the content of the Container

    But the locActiveTab (set on button OnSelect) is not updated - it is the last ID number of selected button.

    To explain this condition of the button Visible property:

    ThisItem.TabName <> "Info Tab" Or gblProjectFormMode = "view" Or gblNewProjectSubmitted

     gblProjectFormMode is set OnSelect of the Edit Icon: 

    Set(gblProjectFormMode, "edit");

    Edit Icon is made invisible while Cancel Icon visible. The Cancel icon set gblProjectFormMode to "view". So when click it, my last button/tab 'Info Tab' become visible again.

    gblNewProjectSubmitted does not  play a role in these steps - it is always false.

     

    It is a good point to test it out in a new clean canvas app. I'll continue tomorrow.

    Thanks.

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Hmm, maybe the gallery template / item itself has a fixed width. I'd check your variables and see if there is an update somewhere else. If you go to ... variables, it'll show the uses etc. maybe it's getting set somewhere on another event. Worse case, I'd just somehow figure out how to just Filter the Items property so the item is just no longer there with certain conditions instead of hiding the control itself. That should work. 

  • Verified answer
    syd Profile Picture
    39 on at

    Hi, just to close this topic. Unfortunatelly, I hadn't time to test more.

    But I made it working just with manipulating the Width property of the Gallery so that the invisible Button was off the Gallery template:

    If(gblProjectFormMode = "view",1209, 1057)

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard