After version 20.3.0.XX, sidebar causes content to shift off of right side of page.
As the title states, we've recently been updating our package references and when going through Syncfusion, we found that any version above 20.3.0.XX (e.g. the most current 22.1.39) causes content to shift off of the page when using the Sidebar component.
Example without shift:
Example with shift:
The overflow-x CSS property is currently set to hidden to prevent horizontal scroll bars, changing this allows scrolling right to see the hidden content but this is not an ideal solution. The content does not shift when the sidebar is removed or commented out.
Hi Kyle,
Greetings from Syncfusion support.
We have validated your reported query in the Blazor Sidebar component by using your shared details, and we understand that you are facing an issue with the Sidebar component at your end. But we need some additional details to reproduce the exact issue on our end.
Could you please share your Sidebar component's complete code snippets or provide a sample that replicates the issue? Based on that, we will investigate further and promptly provide you with a solution. Kindly get back to us with the requested details.
Regards,
Prasanth Madhaiyan.
@using Syncfusion.Blazor.Navigations
@using Syncfusion.Blazor.Buttons
@inject IJSRuntime JS
@inject NavigationManager NavigationManager
<SfSidebar EnablePersistence="true" Width="12rem" Target=".page" DockSize="2.6rem" EnableDock="true" Type="@SidebarType.Push" @bind-IsOpen="@SidebarToggle">
<ChildContent>
<div class="dock">
<ul>
<li class="sidebar-item" id="toggle" @onclick="Toggle">
<span style="color:var(--left-icon);font-size:2rem" class=@PrefixIcon></span>
</li>
@if (MenuData != null)
{
@foreach (var item in MenuData)
{
<li class="sidebar-item">
@if (!SidebarToggle)
{
<SfButton CssClass="e-btn e-round e-flat" IconCss="@item.Icon" IsPrimary="true" @onclick="@(e => NavigateTo(item.Target))"></SfButton>
}
else
{
<SfButton CssClass="e-custom e-flat" IconCss="@item.Icon" IsPrimary="true" @onclick="@(e => NavigateTo(item.Target))">@item.Name</SfButton>
}
</li>
}
}
</ul>
</div>
</ChildContent>
</SfSidebar>
public List<MenuItemDetails>? MenuData { get; set; }
private void NavigateTo(string target)
{
NavigationManager.NavigateTo(target);
}
private bool SidebarToggle = false;
string PrefixIcon = "e-icons e-menu";
string ListItemCss = "d-none e-list-item-header";
/// <summary>
/// expander
/// </summary>
/// <param name="args"></param>
private void Toggle(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
if (SidebarToggle)
{
ListItemCss = "d-none e-list-item-header";
}
else
{
ListItemCss = "e-list-item-header";
}
SidebarToggle = !SidebarToggle;
}
/// <summary>
/// go to menu
/// </summary>
/// <param name="args"></param>
public void OnSelect(Syncfusion.Blazor.Lists.ClickEventArgs<MenuItemDetails> args)
{
if (!string.IsNullOrWhiteSpace(args.ItemData.Target))
{
NavigationManager.NavigateTo(args.ItemData.Target);
}
}
}
Hi Kyle,
As per the shared details, we understand that you are facing an issue with the Sidebar component at your end. However, we prepared the sample using your shared code snippets and we noticed that the Sidebar component is being pushed when it's opening for both versions, as you mentioned (v20.3.0.61 and the latest version). Additionally, you have set the Type for the Sidebar component as Push, which means the Sidebar pushes the main content area and it’s the default behavior.
For your reference, we have attached a sample.
Check out the attached sample, and if the issue still persists, replicate the issue in the shared sample or share the replicated sample with video footage of the issue. Based on that, we will check and provide you with a prompt solution. Kindly get back to us with the requested details.
Regards,
Prasanth Madhaiyan.
Attachment: BlazorSidebar_9afc89f4.zip
- 3 Replies
- 2 Participants
-
KW Kyle White
- Jul 24, 2023 10:32 PM UTC
- Jul 26, 2023 01:14 PM UTC