The menu item fails to move the adjacent menu downwards

I'm encountering an issue with my dropdown menu displayed in the screenshot below. One of the menus in my list isn't pushing down the next one as expected. I suspect there is a CSS problem causing this behavior, but I haven't been able to find a solution yet. Although my description may be lacking in detail, I am unsure of what exactly is causing the problem. If you require additional information or files, please let me know so I can provide them.

https://i.sstatic.net/ycJ1o.png

<mat-nav-list>
<!--    overflow hidden-->
<div *ngFor="let item of menuItems" style="overflow: visible;">
    <!-- if it's not desabled and not a separator and not icon -->
    <mat-list-item
        sideNavAccordion
        class="sidebar-list-item"
        role="listitem"
        *ngIf="!item.disabled && item.type !== 'separator' && item.type !== 'icon'"
        [ngClass]="{'has-submenu': item.type === 'dropDown'}"
        routerLinkActive="open">
        <mat-icon *ngIf="item.icon === 'dvr'" style="width: 30px; height: 30px;
                    position: absolute;
                    left: 89%;
                    top: 0; background: transparent !important;" svgIcon="insignia" matTooltip="PRO"></mat-icon>
        <a routerLink="/{{item.state}}" *ngIf="item.type === 'link'">
    <span
        class="menu-item-tooltip"
        matTooltip="{{item.tooltip | translate}}"
        matTooltipPosition="right"></span>
            <mat-icon>{{item.icon}}</mat-icon>
            <span>{{item.name | translate}}</span>
        </a>
        <a *ngIf="item.type === 'dropDown'">
    <span
        class="menu-item-tooltip"
        [matTooltip]="item.tooltip"
        matTooltipPosition="above"></span>
            <mat-icon>{{item.icon}}</mat-icon>
            <span>{{item.name | translate}}</span>
            <span fxFlex></span>
            <mat-icon class="menu-caret">arrow_drop_down</mat-icon>
        </a>
        <a [href]="item.state" *ngIf="item.type === 'extLink'" target="_blank">
    <span
        class="menu-item-tooltip"
        [matTooltip]="item.tooltip"
        matTooltipPosition="right"></span>
            <mat-icon>{{item.icon}}</mat-icon>
            <span>{{item.name | translate}}</span>
        </a>
        <mat-nav-list class="sub-menu" role="list" *ngIf="item.type === 'dropDown'">
            <mat-list-item
                routerLinkActive="selected"
                *ngFor="let subItem of item.sub">
                <a routerLink="{{item.state ? '/'+item.state : ''}}/{{subItem.state}}">{{subItem.name |
                    translate}}</a>
            </mat-list-item>
        </mat-nav-list>
    </mat-list-item>
    <mat-divider></mat-divider>
    <!-- If item type is separator -->
    <div class="mt-1 mb-1" *ngIf="!item.disabled && item.type === 'separator'">
        <mat-divider></mat-divider>
        <span class="nav-section-title text-muted" *ngIf="!!item.name">{{item.name | translate}}</span>
    </div>
</div>

.sidebar-panel.mat-sidenav .mat-nav-list .sidebar-list-item .mat-list-item-content {
    font-size: .875rem !important;
    display: block;
    overflow: hidden;
    height: auto;
    padding: 0;
    width: 100%;
    -webkit-transition: max-height .3s cubic-bezier(.35, 0, .25, 1);
    transition: max-height .3s cubic-bezier(.35, 0, .25, 1);
}
.mat-nav-list .mat-list-item-content.mat-list-item-focus, .mat-nav-list .mat-list-item-content:hover {
    background: transparent;
}
.sidebar-list-item.open > .mat-list-item-content {
    background: rgba(0, 0, 0, .03);
}
.sidebar-panel .mat-nav-list a {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    height: 48px;
    padding: 0 16px 0 0;
    z-index: 99;
}
.sidebar-panel.mat-sidenav .sidebar-list-item mat-icon:not(.menu-caret) {
    text-align: center;
    margin-right: 3px;
    height: 48px;
    width: 48px;
    line-height: 48px;
    border-left: 3px solid;
    border-color: transparent;
}
.sidebar-panel.mat-sidenav .sidebar-list-item mat-icon.menu-caret {
    float: right;
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
    -webkit-transition: all .3s cubic-bezier(.35,0,.25,1);
    transition: all .3s cubic-bezier(.35,0,.25,1);
}
.sidebar-panel.mat-sidenav .sidebar-list-item.open mat-icon.menu-caret {
    float: right;
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}
.sidebar-panel.mat-sidenav .mat-list-item-content > a {
    width: 100%;
    display: flex;
    box-sizing: border-box;
    flex-direction: row;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
}
.sidebar-panel.mat-sidenav .sidebar-list-item {
    max-height: 48px;
    overflow: hidden;
    -webkit-transition: all .3s cubic-bezier(.35,0,.25,1);
    transition: all .3s cubic-bezier(.35,0,.25,1);
}
.sidebar-panel.mat-sidenav .sidebar-list-item.open {
    max-height: 1000px;
    overflow: visible;
}
.sidebar-panel.mat-sidenav .sidebar-list-item.open > .mat-list-item-content > .sub-menu {
    max-height: 1000px;
}
.sidebar-panel.mat-sidenav .sidebar-list-item .sub-menu {
    padding: 0;
    -webkit-transition: max-height .3s cubic-bezier(.35,0,.25,1);
    transition: max-height .3s cubic-bezier(.35,0,.25,1);
    border-left: 3px solid transparent;
}
.sidebar-panel.mat-sidenav .sidebar-list-item .sub-menu .mat-list-item {
    -webkit-transition: height .3s cubic-bezier(.35,0,.25,1);
    transition: height .3s cubic-bezier(.35,0,.25,1);
}
.sidebar-panel.mat-sidenav .sidebar-list-item .sub-menu .mat-list-item.selected {
    background: rgba(0, 0, 0, .05);
}

.sidebar-panel.mat-sidenav .sub-menu a {
    padding-left: 54px;
}
.app-side-nav-container .mat-sidenav-content {
    padding: 0;
}

Answer №1

Identified the issue and resolved it using the following steps:

  • The menuItems div should have overflow: hidden
  • The element should be set to display: inline-block

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Difficulty transferring information between two components by using services

I am trying to pass the values of an array from the Search component to the History component in order to display the search history. My current code structure looks like this: search-page.component.ts export class SearchPageComponent implements OnInit ...

Live Server in VS Code not refreshing automatically as expected

My problem is with VS Code and Live Server for HTML CSS. I expected the page to automatically reload after editing my HTML, but that's not happening. Even though I have Auto-Save enabled, Live Server isn't updating or refreshing my page automati ...

Place element H1 below H2 on the webpage, but keep it positioned above H2 in the underlying

I have a snippet of HTML Code: <html> <head> <title>css test</title> <style type="text/css"> .box{width:100%;float:left;background:red} </style> </head> <body> <h1>Title To Appear Below Div on Page< ...

What is the best way to make a div automatically scroll to the bottom of its height in

I've spent a considerable amount of time searching for an answer to this question, but unfortunately, none of the solutions I found were suitable for my specific scenario. Currently, I am developing a Chat Application and one key feature is displayin ...

Upgrading CSS sprite sheets for retina displays boosts image size by two-fold

I'm currently incorporating CSS sprite sheets into a mobile-friendly page design. The layout appears as intended, and below is the CSS I have implemented (which displays correctly on Chrome Canary's iPhone 3GS emulator): div#logo { backgroun ...

AngularFire2 version 5.0 entities

As I navigate through AngularFire2, starting with version 5.0 and encountering numerous recent changes, I find that much of the information available online is outdated. My main goal right now is to retrieve an object from my Angular database and pass its ...

What is the actual purpose of the <header> and <footer> elements in web design?

Why are headers and footers important on a webpage? Considering that they appear in the order they are written on the page, as shown here, what distinguishes a header from a footer? <article> <footer>This is a footer</footer> &l ...

Center alignment of all the flex items on the display

In order to achieve my desired effect, I have red elements that must be displayed as flex and cannot be changed. I want to place text above the middle of these red elements. The expected result is shown in this image: https://i.sstatic.net/w3cQS.png Curr ...

Switching the background image of a div by clicking on a different div

To start, you can locate all of my code right here. http://jsfiddle.net/yfukm8kh/1/ The issue I'm encountering pertains to the following section. var changePic = function (direction, id, array) { var intID = parseInt(id); var intDir = pars ...

A simple way to eliminate angular expression attributes from an element

Is it possible to dynamically remove Angular expressions? I attempted the following method with no success: The Button <button myDirective [disabled]="someExpression">Clippy</button> Custom Directive @Directive({ selector: '[myDirec ...

Retrieve objects from an array that contain a certain specified key

I am trying to extract the objects from All_reports that contain the key: comentarioAdmin. Currently, I am retrieving all reports from All_reports, but I only want the reports that have the key comentarioAdmin. Thank you! getReports() { this.Service.g ...

Angular Material Design Components is displaying the error message "The mixin mdc-top-app-bar-fill-color does not exist"

Currently, I'm working with angularCLI and angular-MDC and I am trying to implement the second color from my styles.scss file. I came across this syntax on the following website which is mdc-top-app-bar-fill-color($color). When I tried using it, I re ...

Integrating Google Analytics into an Angular 16 application without using app.module

I have a unique Angular 16 application that consists of standalone components and I am currently in the process of setting up Google Analytics. After some research, I believe this particular package is the solution we need. I proceeded to install it and ad ...

Using Jquery to swap out the content of an inner div with something

I have been attempting to swap out a nested div with a new one. html_string= "<div id='container'><div id='inner'></div></div>"; var newHtml = $(html_string).find("div#inner").replaceWith("<div>NEW CONTE ...

Implementing Role-Based Access Control in Node.js

As a newcomer, I have been given the task of managing roles in our project. We have a total of 7 roles: Admin Insurer Investor Customer Moderator Lender Agent The Admin role can access all APIs, but some APIs can only be accessed by specific combinations ...

What's the best way to ensure that columns clear properly when using bootstrap?

Instead of providing code to solve an issue, I am using Bootstrap and encountering problems with the roster section where the heights are inconsistent. My temporary solutions involved adding classes to specific divs or setting fixed column heights, but I&a ...

Updating a row individually in SQL Server 2008 with ASP.NET: A step-by-step guide

In my form, I have a variety of fields displayed in the image below: View Image of the Form Attached is a screenshot of the database with three different values inserted into three separate rows. Surprisingly, when I updated one row, all three rows were ...

Nginx proxy pass interferes with the execution of Javascript within script tags

I currently have a website built with Nuxtjs that is functioning behind an nginx proxy_pass configuration. For instance, the Nuxtjs site can be accessed at , while the main site is located at http://example.com. Below is the nginx configuration for exampl ...

Modifying the opacity of the placeholder in Stripe Element is not possible

The placeholders of Stripe React elements come with a CSS property Opacity: 1. Unfortunately, this property cannot be modified using the style object. However, other ::placeholder CSS properties can be adjusted as needed. Style Object: const iframeStyles ...

Expanding Input Field to Fill Available Space Using Bootstrap

I have developed a sample here: jsFiddle <div class="container"> <div class="row"> <div class="span6"> <ul class="thumbnails"> <li class="span4"> <div style="height:200px; position: relative" ...