Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in persist sidebar toggle between refreshes #97

Open
rajeshvaishnav opened this issue May 31, 2021 · 3 comments
Open

Issue in persist sidebar toggle between refreshes #97

rajeshvaishnav opened this issue May 31, 2021 · 3 comments

Comments

@rajeshvaishnav
Copy link

when we enable this code and toggled sidebar

if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
document.body.classList.toggle('sb-sidenav-toggled');
}

after that when we hit refresh the sidebar comes for a second, I want when sidebar toggled its will completely hidden when refresh the page (right now its comes for second ) can you please suggest any solution for this issue.

please check attached gif file for more clarification.

Profile-20210531T100719

@markvangeffen
Copy link

I changed the css so that it does not flow sideways anymore. I think the design is that it's supposed to work that way. I hope this solution helps you.

Greets,

Mark

.sb-sidenav-toggled #layoutSidenav #layoutSidenav_nav {
/* Changed sidenac toggle transition, now just hides the navbar with margin-left. The transform is outcommented /
margin-left: -225px;
/
transform: translateX(0); */
}

@media (min-width: 992px) {
#layoutSidenav #layoutSidenav_nav {
transform: translateX(0);
}
#layoutSidenav #layoutSidenav_content {
/* Changed sidenac toggle transition, now just hides the navbar with by commenting out transition /
margin-left: 0;
/
transition: margin 0.15s ease-in-out; */
}

@nikhilcb
Copy link

I changed the css so that it does not flow sideways anymore. I think the design is that it's supposed to work that way. I hope this solution helps you.

Greets,

Mark

.sb-sidenav-toggled #layoutSidenav #layoutSidenav_nav { /* Changed sidenac toggle transition, now just hides the navbar with margin-left. The transform is outcommented / margin-left: -225px; / transform: translateX(0); */ }

@media (min-width: 992px) { #layoutSidenav #layoutSidenav_nav { transform: translateX(0); } #layoutSidenav #layoutSidenav_content { /* Changed sidenac toggle transition, now just hides the navbar with by commenting out transition / margin-left: 0; / transition: margin 0.15s ease-in-out; */ }

couldn't understand, couldn't find those classes

@markvangeffen
Copy link

I changed the css so that it does not flow sideways anymore. I think the design is that it's supposed to work that way. I hope this solution helps you.
Greets,
Mark
.sb-sidenav-toggled #layoutSidenav #layoutSidenav_nav { /* Changed sidenac toggle transition, now just hides the navbar with margin-left. The transform is outcommented / margin-left: -225px; / transform: translateX(0); / }
@media (min-width: 992px) { #layoutSidenav #layoutSidenav_nav { transform: translateX(0); } #layoutSidenav #layoutSidenav_content { /
Changed sidenac toggle transition, now just hides the navbar with by commenting out transition / margin-left: 0; / transition: margin 0.15s ease-in-out; */ }

couldn't understand, couldn't find those classes

You can find these in the styles.css. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants