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

[Bug] Sidenav goes back to light mode when resized in dark mode #84

Open
EnzoKilm opened this issue Apr 28, 2022 · 5 comments
Open

[Bug] Sidenav goes back to light mode when resized in dark mode #84

EnzoKilm opened this issue Apr 28, 2022 · 5 comments

Comments

@EnzoKilm
Copy link

Version

Latest

Reproduction link

https://demos.creative-tim.com/argon-dashboard/pages/dashboard.html

Operating System

Windows 10

Device

Laptop

Browser & Version

Chrome v100.0.4896.127

Steps to reproduce

  1. Open the link provied (it works on every page of the demo page)
  2. Switch to dark theme
  3. Resize the page (either resize the browser's window or open the JS console)

What is expected?

The sidenav needs to stay in the choosen theme color

What is actually happening?

The sidenav goes back to the light mode colors instead of staying dark


Solution

Additional comments

This bug is on both the free and pro version

@EnzoKilm
Copy link
Author

After having JS issues with removing the fixed-plugin div, I had to remove the following event listeners in the code :
window.addEventListener("resize", navbarColorOnResize); window.addEventListener("resize", sidenavTypeOnResize); window.addEventListener("load", sidenavTypeOnResize);
After that, the color change was gone. This could be helpful to fix the bug.

@itschasa
Copy link

had similar issue, this fixed it. thank you <3

@vladutt
Copy link

vladutt commented Jan 31, 2023

+1

After having JS issues with removing the fixed-plugin div, I had to remove the following event listeners in the code : window.addEventListener("resize", navbarColorOnResize); window.addEventListener("resize", sidenavTypeOnResize); window.addEventListener("load", sidenavTypeOnResize); After that, the color change was gone. This could be helpful to fix the bug.

@rubicon-sibenik
Copy link

rubicon-sibenik commented May 11, 2023

Had same issue, this helped, it's ok now when resizing (in browser), but when clicking on "iconNavbarSidenav" it popups white instead of dark. Have any suggestions?
Thanks!
image

@Tibi-GG
Copy link

Tibi-GG commented Feb 2, 2024

Had same issue, this helped, it's ok now when resizing (in browser), but when clicking on "iconNavbarSidenav" it popups white instead of dark. Have any suggestions? Thanks! image

function toggleSidenav() {

remove > sidenav.classList.add('bg-white');

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

5 participants