Topic: Sidenav working in the snippet but not VSCode

BradleyByerly04 priority asked 5 months ago


Expected behavior Sidebar would collapse when viewed in live server in VS Code Actual behavior Does not collapse, but it works as intended when in the snippet Resources (screenshots, code snippets etc.)

Snippet


Grzegorz Bujański staff answered 4 months ago


Do you have any errors in the console?

Have you added the data-mdb-sidenav-init data attribute to Sidenav?

Are you importing the mdb.umd.min.js file in the head or at the end of the body?


BradleyByerly04 priority commented 4 months ago

The issue was I forgot to import that file, I saw the mdb.min.js but glossed over the fact that this was mdb.umd.min.js

Thank you for the help.


BradleyByerly04 priority answered 4 months ago


This is pretty time sensitive for me as this website I'm working on is for a customer.


BradleyByerly04 priority commented 4 months ago

I've now imported the folder 3 times from the command console and the sidenav doesn't work.


Kamila Pieńkowska staff answered 4 months ago


This means you may have not imported JS files correctly.

Make sure:
- file name is mdb.umd.min.js
- the path is correct
- you copy code snippets from the version you have and intend to use


BradleyByerly04 priority commented 4 months ago

I'm not very familiar with JS, but when I view that file a lot of the text is white, indicating it's missing something until I scroll about 3/4s of the way down.

I'm using the folder that the console made when doing the initialization.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.0.0
  • Device: PC
  • Browser: Opera GX 104.0.4944.80
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes