creativetimofficial / ct-material-dashboard-pro

Material Dashboard Pro - Premium Bootstrap 5 Admin
https://demos.creative-tim.com/material-dashboard-pro/pages/dashboards/analytics
116 stars 28 forks source link

Menu wrap issue: Material Dashboard Navigation Bar #269

Open saiketjaman opened 4 years ago

saiketjaman commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

Normally when we click a nav-menu item it should close the previously opened nav-menu item.

Current Behavior

Currently, it is showing all previously opened nav-menu items. when I click the new nav-menu item. Kindly check the link below. Thanks, Bug1 https://demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. you get it...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

groovemen commented 4 years ago

Hello @saiketjaman,

Thank you for using our products, to achieve this behavior, you have to set the following function() into your project.

$collapse.on('show.bs.collapse', function () {
    $(this).parent().siblings().children('.collapse').each(function(){
      $(this).collapse('hide');
    });
  });

Hope that information helps you. Please let us know if we can help you with anything else.

All the best, Stefan