cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Problem with hiding menu when entering a screen

Hi,

 

I have a Expanding/Collapsing/Hide menu in my app but it doesn't work as I need it to. Maybe it's a bug in Power Apps?

 

What I want

When a user enters a screen the menu should be hidden and the user need to press a button if he/she wants to see the menu.

I need it to be hidden since I need that extra space in my app.

 

The Problem

In Play mode

The auto-hide function doesn't work at all. I have to manually hide the menu every time I enter a screen.

 

How I enter the "Play" mode
1.png 

In Studio Mode -> Preview (F5)

It works as it should the first time I enter a screen but then it doesn't until I
- Close the app and opens it again

- Or wait and it might have fixed it self.

 

The App

The Code
On 3 of my 4 screens I have this code in the OnVisible property of the screen:

If(
    expandCollapse = false,
    UpdateContext({expandCollapse: true})
)


And my hamburger menu has this code on it's OnSelect property: 

UpdateContext({Timer: false});
UpdateContext({expandCollapse:!expandCollapse, Timer:true})

 

 

The Source/Foundation 

I followed this video and used it as the foundation for my menu: https://youtu.be/D_Kb7AXSE0s
Start at 7:24: https://youtu.be/D_Kb7AXSE0s?t=444
End at 20:04: https://youtu.be/D_Kb7AXSE0s?t=1202

 

 

Anyone have any tips or ideas on how to solve this?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Problem with hiding menu when entering a screen

Hi @ZowieS :

I got it!The reason lies in the timer.

Just change one place:

Set the screen's OnVisible proeprty to:

 

UpdateContext({Timer:false});UpdateContext({expandCollapse:false,Timer:true})

 

28.gif

Best Regards,

Bof

View solution in original post

4 REPLIES 4
Highlighted
Microsoft
Microsoft

Re: Problem with hiding menu when entering a screen

Hi @ZowieS :

Could you tell me?

  • Do you want the menu to be hidden every time the user opens a new screen?
  • What is the visible property of the menu?
  • Is it 

 

!expandCollapse

 

      ?I think it should be !expandCollapse.

I suggest you try again using global variables.

The Code
On 3 of my 4 screens I have this code in the OnVisible property of the screen:

 

If(
    !expandCollapse,
    Set(expandCollapse,true)
)

 

And my hamburger menu has this code on it's OnSelect property: 

 

Set(Timer,false);
Set(expandCollapse,!expandCollapse);Set(Timer,true)

 

If it still doesn't work, could you provide more detailed information about your app?

Best Regards,

Bof

 

Highlighted
Helper II
Helper II

Re: Problem with hiding menu when entering a screen

Hi @v-bofeng-msft,

 

Thanks for your reply!


Question:


@v-bofeng-msft wrote:

Hi @ZowieS :

Could you tell me?

  • Do you want the menu to be hidden every time the user opens a new screen?

Answer:

Yes, that is correct.


Question:


@v-bofeng-msft wrote:

Hi @ZowieS :

Could you tell me?

  • What is the visible property of the menu?
  • Is it 

 

!expandCollapse

 


Answer:

 

The Visible property is set to true.

And the X property is set to: 

 

 

If(expandCollapse,-'Navigation-Background_4'.Width + 'Navigation-Background_4'.Width * ('Timer-NewRequestScreen'.Value/'Timer-NewRequestScreen'.Duration),-'Navigation-Background_4'.Width * ('Timer-NewRequestScreen'.Value/'Timer-NewRequestScreen'.Duration))

 

 

 

Question:

 


@v-bofeng-msft wrote:

I suggest you try again using global variables.


Answer:
The variable "expandCollapse" only exist on 3 out 4 screens since there is no need for it on the Main/First screen.

The Main/First screen only contains a picture and the navigation.

 

Question:


@v-bofeng-msft wrote:

The Code
On 3 of my 4 screens I have this code in the OnVisible property of the screen:

 

 

 

If(
    !expandCollapse,
    Set(expandCollapse,true)
)

 

 

And my hamburger menu has this code on it's OnSelect property: 

 

 

Set(Timer,false);
Set(expandCollapse,!expandCollapse);Set(Timer,true)

 

 

 

If it still doesn't work, could you provide more detailed information about your app?

Best Regards,

Bof

 

Answer:

Sorry, there is no different from my set-up.


I recorded of what doesn't happen when I try it in Play -mode
Link: https://youtu.be/APm8qGRZs7Y  

 

Highlighted
Microsoft
Microsoft

Re: Problem with hiding menu when entering a screen

Hi @ZowieS :

I got it!The reason lies in the timer.

Just change one place:

Set the screen's OnVisible proeprty to:

 

UpdateContext({Timer:false});UpdateContext({expandCollapse:false,Timer:true})

 

28.gif

Best Regards,

Bof

View solution in original post

Highlighted
Helper II
Helper II

Re: Problem with hiding menu when entering a screen

Thank you!

That worked great!

 

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,578)