BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Hello
I used two SfSideBars:
1- Currently, both sidebars are displayed by default. How to hide SfSideBarProfile by default and show it only when the user clicks the "Show Profile" button?
2- When SfSideBarProfile is hidden. If the user resizes his browser, SfSideBarProfile will be displayed. How to prevent this?
The related file is attached.
.net 8 , syncfusion version: 25.1.35
Hi Sarah,
Greetings from Syncfusion,
[Query: 1 – Hiding the profile sidebar]
We have achieved your requirement by making use of the Created event and prevent the opening of Sidebar in initial rendering. Refer the code changes below,
[MainLayout.razor]
<SfSidebar EnableGestures="false" Width="280px" Position="SidebarPosition.Right" ShowBackdrop="false" MediaQuery="(min-width:600px)" Target=".main-content" @ref="sfSidebarProfile" IsOpen="SidebarToggleProfile" CloseOnDocumentClick="false" Animate="true" Type="SidebarType.Over" Created="OnCreated" OnOpen="OnOpen"> </SfSidebar>
public void OnCreated() { sfSidebarProfile.IsOpen = false; } |
[Query: 2 – Preventing the hiding of Sidebar during window resize]
We can prevent the hiding of sidebar during window resize by making use of the OnOpen event. Refer the code changes below,
[MainLayout.razor]
<SfSidebar EnableGestures="false" Width="280px" Position="SidebarPosition.Right" ShowBackdrop="false" MediaQuery="(min-width:600px)" Target=".main-content" @ref="sfSidebarProfile" IsOpen="SidebarToggleProfile" CloseOnDocumentClick="false" Animate="true" Type="SidebarType.Over" Created="OnCreated" OnOpen="OnOpen"> </SfSidebar> |
We have attached the sample for your reference,
Sample: Attached as zip file.
Kindly try out the shared details and get back to us if you need further assistance.
Regards,
Jafar
Hi ,
Thank you very much for your response. I want to close the sfSidebarProfile automatically when the user clicks somewhere else outside the sfSidebarProfile . I used CloseOnDocumentClick="true" and didn't get results.
Hi Sarah,
On validated your query we found that the Sidebar is closing while clicking anywhere on the page and we regret to inform you that we cannot be able to replicate the issue from our end.
We kindly suggest you to provide some additional details such as issue replication steps, issue replicating sample or try to replicate the issue in the attached sample this will help us to provide you a prompt solution.
We have attached the sample for your reference,
Sample: Attached as zip file
Kindly try out the shared details and get back to us if you need further assistance.
Regards,
Jafar