-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sidenav Toggle ON with window width breakpoint if hidden #176
Comments
I think I've pinpointed the confusion in the CSS. It has to do with the term "toggled". This little mismatch works while for resizing the window from large to small while the nav is visible (aka no sb-sidenav-toggled class on the body) because when it triggers the @media query in CSS it loses its visibility. But that means if it is hidden for the large view (aka has sb-sidenav-toggled class on the body) then resizing to a smaller view causes it to become visible and is pretty annoying to the end user. I'm still trying to find a solution to this problem and if I do I'll post it here. |
I found a potential solution in case anyone else needs to fix this. I basically changed the selector for 3 CSS entries so that the logic about toggle was consistent. "toggled" means off with these changes. Hopefully this helps someone! Around line 11381 change
to
Around 11347 change:
to
Finally it needs a little javascript to appropriately hide the menu when the window width is suddenly small. (optional really)
|
Symptom: Sidenav appears during window resize if it was hidden before.
While using Chrome (and possibly others) you can load the sample https://startbootstrap.com/previews/sb-admin and recreate the issue by doing the following:
Click the horizontal bars that hides the menu from view.
Resize your window until the width is less than 994 pixels.
The expected result is that the sidenav stays hidden.
The actual result is that the sidenav comes into view.
The issue does not occur if the sidenav is not hidden during the resize.
I am actively trying to find a workaround to this issue.
The text was updated successfully, but these errors were encountered: