Topic: Sidenav .changeMode

Andrew Ford priority asked 3 years ago

Expected behavior

Actual behavior

The sidenav initiated. Then I wanted to build this, I copied and pasted everything, the HTML, the CSS and the JS. The sidenav still loads, in the console I see this error (see below resources).

Resources (screenshots, code snippets etc.)

Uncaught TypeError: Cannot read property 'changeMode' of null

Magdalena Dembna staff commented 3 years ago

I cannot reproduce your issue without additional data - can you run a console.log on a sidenav and sidenavInstance variables? It seems like the second one is null. Try resizing the window - does the error still appear or is it just on load? Do you have additional code in your <script> tags?

Andrew Ford priority commented 3 years ago

sidenav and sidenavInstance are null in the console.

The resize event is not firing. I don't have any additional code.

Magdalena Dembna staff commented 3 years ago

Can you edit the ticket so it includes your entire code? If it doesn't find the sidenav it's probably an issue with the ID. You can also test the code here:

tjklug11 free commented 2 years ago

Andrew - I am having the same issue. Did you ever find the resolution? Thanks in advance.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: 1.0.0
  • Device: N/A
  • Browser: N/A
  • OS: N/A
  • Provided sample code: No
  • Provided link: Yes