Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Invisible Button inside Gallery is clickable

(0) ShareShare
ReportReport
Posted on by 38

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:
  • Verified answer
    syd Profile Picture
    syd 38 on at
    Re: Invisible Button inside Gallery is clickable

    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)

     

  • cwebb365 Profile Picture
    cwebb365 3,294 on at
    Re: Invisible Button inside Gallery is clickable

    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. 

  • syd Profile Picture
    syd 38 on at
    Re: Invisible Button inside Gallery is clickable

    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
    cwebb365 3,294 on at
    Re: Invisible Button inside Gallery is clickable

    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
    syd 38 on at
    Re: Invisible Button inside Gallery is clickable

    @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
    cwebb365 3,294 on at
    Re: Invisible Button inside Gallery is clickable

    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
    syd 38 on at
    Re: Invisible Button inside Gallery is clickable

    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.

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Invisible Button inside Gallery is clickable

    @syd

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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard