We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unexpected closure of Sidebar

I have a Sidebar defined in MainLayout.razor, which replaces the MS NavBar.

In NavMenu.razor I have a button which collapses the SideBar, and a TreeView to select items.

Below the TreeView-element, I want to show a ComboBox.

The design works fine so far. The problem is the ComboBox. When I click into the ComboBox or select an item from the ComboBox, everything works okay. But when I "swipe" with the mouse inside the ComboBox, the whole SideBar minimizes. Why does this happen, and how can I avoid this? As worst case, can I somehow "block" the Sidebar, until a ComboBox-Item has been selected?

Thank you for your help


Attachment: MainNavLayout_3e6e54cb.zip

3 Replies

IL Indhumathy Loganathan Syncfusion Team February 27, 2023 01:13 PM UTC

Hi Hartmut,

Greetings from Syncfusion support.

We have validated your requirement in the Blazor Sidebar component. By default, the Sidebar EnableGeustures property is in true state which will expand or collapse the Sidebar while mouse swiping. You can prevent this by setting EnableGestures value as false. Please check the below code snippet.



<SfSidebar HtmlAttributes="@HtmlAttribute" EnableGestures="false"  Width="290px" Target=".e-main-content" MediaQuery="(min-width:600px)" @bind-IsOpen="SidebarToggle" >


Please try the above suggestion and let us know if you need any further assistance.


Indhumathy L

HA Hartmut February 27, 2023 04:00 PM UTC

Dear  Indhumathy,

thank you for your help, it works fine.


IL Indhumathy Loganathan Syncfusion Team March 1, 2023 07:52 AM UTC

Hartmut, we are glad to know that your reported query has been resolved. Please get back to us if you need any further assistance.

Live Chat Icon For mobile
Up arrow icon