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 / Custom component side ...
Power Apps
Answered

Custom component side menu default opened

(1) ShareShare
ReportReport
Posted on by 836 Moderator

I have created a custom component particular for sidemenu that is collapsible by a hamburger icon.

I copied the logic from Creator Kit which functions perfectly but mine doesnt. I don't see any difference in the codes but I am wondering why mine isnt opened by default. 

I'll first put here the properties/codes for the Creator Kit -  ExpandMenu - custom component.
This is attached to a new app with nothing entered on any of the App's properties(OnStart).

kej_0-1720880067455.png

 

 

 

 

 

 

ExpandMenu Width = If(!Self.IsExpanded, 46, 221)

ExpandMenu.DefaultExpanded -- raise OnReset when value changed enabled = true

ExpandMenu.OnReset = Set(IsOpen, ExpandMenu.DefaultExpanded)

ExpandMenu.IsExpanded (output property) = IsOpen


Hamburger icon OnSelect = Set(IsOpen, !IsOpen) 

 

 

 

 

 

 

all of the above code works and the side menu by default is opened. Code below will be my own custom menu that I copied the logic but doesn't work.

 

 

 

 

 

SideMenu_Collapsible.Width = If(
 SideNavigation_Collapsible.MenuExpanded, 
 250, 
 70
)

SideMenu_Collapsible.DefaultExpand = true

SideMenu_Collapsible.OnReset -- raise OnReset when value changed enabled = Set(varMenuExpanded, SideMenu_Collapsible.DefaultExpand)

SideMenu_Collapsible.MenuExpanded (output property) = varMenuExpanded

Hamburger Icon OnSelect = Set(varMenuExpanded, !varMenuExpanded)

 

 

 

 

 

kej_1-1720880925198.png

Image above is the default when the app is first opened

kej_2-1720881014807.png

 

now this is the default of the side menu of the other app. Everything is basically similar.
why is my custom side menu not opened by default???

I noticed that the only difference between two apps are mine are enclosed with containers and the other app isn't. I dont know if this should affect anything but might as well indicate it here.

 

Categories:
I have the same question (0)
  • VeGETzX Profile Picture
    367 on at

    Hi @kej 

     

    Is it possible to export the app .zip that contains just the component and upload it here?

    So I can import to my environment and try debugging.

  • KevinGador Profile Picture
    836 Moderator on at

    yes sure 

  • VeGETzX Profile Picture
    367 on at

     

    I'm not sure if I got anything wrong, but I only see the component named ExpandMenu (it's expanded by default).

    Can I have the component that you created which doesn't work?

    VeGETzX_0-1720885617929.png

     

  • KevinGador Profile Picture
    836 Moderator on at

    oh I thought you wanted this one. 
    okay wait let me just create the zip file for it.

  • KevinGador Profile Picture
    836 Moderator on at

    here it is. Please do let me know if you have downloaded the zip file already. 🙂 


    Edit: removed it. 

  • Verified answer
    VeGETzX Profile Picture
    367 on at

    When the app was just launch, variable varMenuExpanded, inside the component is still Blank even you have set DefaultExpand to true

    VeGETzX_0-1720888425730.png

     

    So, all condition reference to this variable will be false and this cause your side menu open in collapse mode

     

    As per my try, this seem to fix the problem, just add Reset() function to screen OnVisible() to reset the component if is MenuExpanded value is Blank

     

    Screen1.OnVisible = If(
     SideNavigation_Collapsible_3.MenuExpanded = Blank(),
     Reset(SideNavigation_Collapsible_3)
    )

     

    VeGETzX_2-1720889784941.png

     

    However, still didn't find the cause why there is no issue with Creator Kit component. I will keep you posted if I found any clue.

     

    Hope this help!

  • KevinGador Profile Picture
    836 Moderator on at

    I have tried resetting before in the OnStart property of the app but I can't reset the component and thought that Resetting the component is impossible in any properties.

    Also, I have tried what you suggested and it worked! I guess its a lesson learned that I should not assume that it won't work automatically if it doesnt work with a certain property...

    Thanks a lot! 

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 977

#2
Valantis Profile Picture

Valantis 664

#3
11manish Profile Picture

11manish 530

Last 30 days Overall leaderboard