gvonhagel pro asked 6 years ago


Hey there, I've noticed an issue when using the DoubleNav that may be the intended behavior but is kinda disruptive for my use case. When using the side-nav, I noticed it automatically appends the 'fixed-sn' class to the body. In my case, I only use the sidenav on a dashboard page, so using <main> elements on my other pages is disruptive when navigating from the dashboard. This doesn't occur when the site first loads, but once I navigate to and away from the dashboard that uses the double-nav, all of my other pages that have their content in a <main> element have their alignment messed up. It would be nice to be able to disable the functionality that adds 'fixed-sn' to the body and just have the ability to manually add that class to a div or other container instead. I have solved my problem by not using <main> elements elsewhere on the site, but this is not ideal.   Thanks, Greyson

Damian Gemza staff answered 6 years ago


Hello Greyson, Is there  a possibility to share me your project? It would be much easier to debug it on our example. Please let me know about that. Best Regards, Damian

gvonhagel pro commented 6 years ago

Hi Damian, I'm not able to share the entirety of the source code but I'm happy to share the code I use as a Dashboard wrapper. (https://gist.github.com/gvonhagel/01733bb1eab7a8c7d9557cb2d406a050) I wrap the entire dashboard in a div with a class of fixed-sn to give the appropriate behavior and all of the child routes for the Dashboard will appear inside the main element. The problem, however, is that using a mdb-sidenav appends the fixed-sn class to the body, which is not the behavior I want in this case as I already have it on my container div. This is further complicated when I navigate away from the Dashboard routes, as the fixed-sn class persists on the body. The behavior I would like is to either be able to specify whether or not I want the fixed-sn class on the body, or to remove it when the Dashboard page is routed away from. Thanks!

Damian Gemza staff commented 6 years ago

Dear Greyson, For now, we haven't got ready-to-use solution for you. We suggest adding a special variable isDashboard with true/false which add/removes styles from body element. We will add your case to our nice-to-have list, and in future, we'll think about implementing this. Best Regards, Damian


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: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags