creativetimofficial / argon-dashboard

Argon - Dashboard for Bootstrap 5 by Creative Tim
https://www.creative-tim.com/product/argon-dashboard
MIT License
664 stars 1.23k forks source link

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

Open EnzoKilm opened 2 years ago

EnzoKilm commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

vladutt commented 1 year ago

+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 commented 1 year ago

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 commented 7 months ago

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');