Blazor Sidebar Persistence not working

It seems that enabling persistence on the sidebar doesn't work.  I specify an Id for the sidebar, and I can see the IsOpen property is populated in the local storage store of the browser.  Toggling the sidebar does switch the IsOpen value in local storage, however, doing a browser refresh just sets the sidebar to an open state and ignores the setting in local storage.  (setting is changed to true in local storage once page loads).

Anything I have done wrong in declaring the sidebar, or did I just discover a bug?

sidebar "header":

<SfSidebar ID="navbar"
           HtmlAttributes="@HtmlAttribute" 
           Target=".main-content"  
           EnableGestures="false" 
           Width="260px" 
           DockSize="50px"  
           EnableDock="true"  
           @ref="Sidebar" 
           Animate="false" 
           @bind-IsOpen="IsSideBarOpen"
           MediaQuery="(min-width: 600px)" 
          EnablePersistence="true"
           >

2 Replies 1 reply marked as answer

IL Indhumathy Loganathan Syncfusion Team January 7, 2021 12:18 PM UTC

Hi HappyCamper, 
 
Thanks for contacting Syncfusion support. 
 
We have validated your reported issue and considered this as bug from our side. We will include this fix in upcoming patch release expected to be released by the mid of January 2021. You can track the status of your reported problem through the below portal link, 
 
 
We appreciate your patience. 
 
Regards, 
Indhumathy L 



SP Sowmiya Padmanaban Syncfusion Team January 28, 2021 10:25 AM UTC

Hi HappyCamper, 
 
Thanks for your patience. 
 
We are glad to announce that our Essential Studio 2020 Volume 4 SP release v18.4.0.39  is rolled out and is available for download under the following link. 
 
 
In this release, we have included fix for EnablePersistence in Sidebar component. Please upgrade your package to latest version (18.4.0.39) to resolve the issue.  
 
Note: IsOpen property is not applicable for type auto. When the type is Auto, it automatically opens the sidebar component on desktop. EnablePersistence is applicable other than Auto mode. 
 
   <SfSidebar ID="sidebar1" HtmlAttributes="@HtmlAttribute" @ref="SidebarObj" EnablePersistence="true" CloseOnDocumentClick="@CloseOnDocumentClick" ShowBackdrop="@ShowBackdrop" Position="@Position" Type="@Type" @bind-IsOpen="SidebarToggle"> 
            <ChildContent> 
                <div class="title-header"> 
                    <div style="display:inline-block"> Sidebar </div> 
                    <span id="close" class="e-icons" @onclick="@Close"></span> 
                </div> 
                <div class="sub-title"> 
                    Place your primary content here. 
                </div> 
            </ChildContent> 
        </SfSidebar> 
 
public SidebarType Type { get; set; } = SidebarType.Push; 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  
 
Regards, 
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon