Responsive sidebar not could change the expanded variable

Hello,
I am having an issue when my sidebar is set as responsive but my "Expanded" variable is set to true in the beginning.
For example if the sidebar closes after loading the page (doing its responsiveness) because the screen is too small, should't it update the variable to false or the other way around? It isn't updating so the button I have to open/close the sidebar has to be clicked twice.
This is the code to close/open
image

Hi @Diogo_Santos,

If I get it right, responsiveness is not needed if you want to control the expanded state. Setting Responsive to false should resolve your issue:

<RadzenSidebar Responsive="false" @bind-Expanded="@sidebarExpanded">

...

@code {
    bool sidebarExpanded = true;
}
1 Like