cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Super User
Super User

Fly out menu visible even if variable is false

Hi

 

So I created a fly out menu according to Shane Youngs example: https://www.youtube.com/watch?v=D_Kb7AXSE0s

I only have one issue, when I start the app the Context variable is false but the fly out menu is still visible.

 

My Square icon (Menu sliding out)
X =

 

If(ShowMenu, -FlyOutMenu.Width + FlyOutMenu.Width * (Timer1.Value/Timer1.Duration), -FlyOutMenu.Width * (Timer1.Value/Timer1.Duration))

 

 

My timer

Start = StartMenuTimer

 

My button for expanding the menu.

OnSelect =

 

UpdateContext({StartMenuTimer:false}); UpdateContext({ShowMenu:!ShowMenu, StartMenuTimer:true})

 

 

My issue is when I Start the app, then the variable ShowMenu = false but the Menu (icon square) is still showing, once I click the button once then it is set to true and the menu slides out and next click the menu it slides in. But the first view when the app starts is that it's out like the ShowMenu = true but it equals false.

 

Im going crazy over this 😥

 

1 ACCEPTED SOLUTION

Accepted Solutions
JimmyWork
Super User
Super User

Solved it

 

MenuBlock

X = If(!varMenu2,1366,1366-200*(Timer3.Value/Timer3.Duration))
Width = If(!varMenu2,100,100+200*(Timer3.Value&Timer3.Duration))

Timer

Start = varTimer
OnTimerEnd = If(!varMenu2,Reset(Timer3),false)

Button

OnSelect = UpdateContext({varTimer:false});UpdateContext({varMenu2:!varMenu2, varTimer:true})

 

This produces a screen that at first shows no menu.

When button is click the menu slides out from the right side, when button is clicked again it closes the menu.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @JimmyWork ,

At screen OnVisible, put this

UpdateContext({ShowMenu:false})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

@WarrenBelz Thank you but I have already tried this and it does not work, it still shows

JimmyWork
Super User
Super User

In another solution that just uses visible true or false, no sliding menu all I had to do was.

OnSelect = UpdateContext({FiltersOn:!FiltersOn});

Visible = If(FiltersOn, true, true, false)

 

The it would not be visible and button works as it should, but with this sliding out menu nothing seems to be working. The variable is false by default so I don't know why it's even showing

JimmyWork
Super User
Super User

test.gifSeems like I got something working like I Want to but I'm pretty sure it's not the correct way of doing this.

 

My Square icon (Menu sliding out)
X =

 

If(!ShowMenu, 670+FlyOutMenu.Width* (Timer1.Value/Timer1.Duration), 670+FlyOutMenu.Width- FlyOutMenu.Width * (Timer1.Value/Timer1.Duration))

 

Visible

 

If(ShowMenu = true, true, false)

 

 

My timer

Start = StartMenuTimer
OnTimerEnd

 

If(!ShowMenu,Reset(Timer1), false)

 

 

My button for expanding the menu.

OnSelect =

 

UpdateContext({StartMenuTimer:false}); UpdateContext({ShowMenu:!ShowMenu, StartMenuTimer:true})

 


 

@JimmyWork ,

As you can understand, I can only be guided by what you posted and if you set the Visible to false and this is the only criteria, it cannot possibly show. It seems the timer also has something to do with it.

@WarrenBelz Not sure what you mean, setting it to false actually made it work. Not showing when started. before i had the issue with when the variable was false the menu was still showing at start and even if you set the variable OnVisble it was still showing.

 

What I posted achieves what I want, but, it's not done correctly like you stated with the visible part.

Defiantly something with the timer but I don't know how to solve this, been stuck on it for to long 😞

JimmyWork
Super User
Super User

Solved it

 

MenuBlock

X = If(!varMenu2,1366,1366-200*(Timer3.Value/Timer3.Duration))
Width = If(!varMenu2,100,100+200*(Timer3.Value&Timer3.Duration))

Timer

Start = varTimer
OnTimerEnd = If(!varMenu2,Reset(Timer3),false)

Button

OnSelect = UpdateContext({varTimer:false});UpdateContext({varMenu2:!varMenu2, varTimer:true})

 

This produces a screen that at first shows no menu.

When button is click the menu slides out from the right side, when button is clicked again it closes the menu.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,971)