Hide Hamburger menu when clicked anywhere on screen
I am currently working on showing a hamburger menu in Powerapps. I am using a variable that is used to show/hide the menu. However I am facing some issues with hiding the menu when clicked anywhere on screen.
I am hiding the menu, when clicked on hamburger icon or when user goes from one screen to another. To hide/show the menu I have used a variable that is set to true when we want to show the menu and set to false when we want to hide it. We can set the variables value using the OnSelect or OnVisible Property in Powerapps.
But currently to hide the menu user needs to click on the hamburger icon but I want to hide the menu when user clicks anywhere on the screen. To hide the menu I am changing the variables value and to change the variables value we need the OnSelect property on Screen but Powerapps doesn’t support OnSelect property for screen.
So typically what we will do is to put a full screen rectangle (icon) on the screen. Move the display order of it backward until it is under your menu. We usually set the Fill property to RGBA(0,0,0,.65) - this will give us a semi-transparent effect (showing all the other controls under it). Then, use the OnSelect action of that icon to put your logic to hide the menu.
Just remember (especially as you add new controls) - the order of controls is important - the top is your menu, then the "blocker" rectangle, then all your other controls. (we typically will group items so its easier to change those orders later if needed).
I hope this helps and gives you some fuel for thought.
_____________________________________________________________________________________ Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did. Check out my PowerApps Videos too!