What's the best way to show a submenu when the main menu is scrollable?

I'm facing a challenge with the following issue:

I am working with angular 8 and utilizing tieredMenu from primeng 8.

The problem arises when I have a scroll, causing the tieredMenu's submenu to be hidden.

Do you have any suggestions on how to solve this?

This is the HTML file snippet:

<div class="app-scroll-perso">
  <div class="scroll-width-perso">
    <p-tieredMenu [model]="items"></p-tieredMenu>
  </div>
</div>

TypeScript File Section:

items: MenuItem[];

ngOnInit() {
    this.items = [
        {
            label: 'File',
            icon: 'pi pi-fw pi-pencil'
        },
        {
            label: 'encouragement',
            icon: 'pi pi-briefcase'
        },
        {
            label: 'primeng',
            icon: 'pi pi-save'
        },
        {
            label: 'contact',
            icon: 'pi pi-cloud-upload'
        },
        {
            label: 'Edit',
            icon: 'pi pi-tags'
        },
        {
            label: 'user',
            icon: 'pi pi-user',
            items: [
                {label: 'Delete', icon: 'pi pi-fw pi-trash'},
                {label: 'Refresh', icon: 'pi pi-fw pi-refresh'},
                {label: 'save', icon: 'pi pi-fw pi-refresh'},
                {label: 'modify', icon: 'pi pi-fw pi-refresh'},
                {label: 'nothing', icon: 'pi pi-fw pi-refresh'}
            ]
        },
        {
            label: 'blog',
            icon: 'pi pi-fw pi-pencil'
        }
    ];
}

CSS style for applying the scroll effect:

.scroll-width-perso {
  max-height: 20vh;
  overflow-y: scroll;
  overflow-x: hidden;
  width: 180px;
}

Here is an example of what has been implemented so far:

https://stackblitz.com/edit/angular-3kxful

Answer №1

Attempt using the CSS property overflow: visible

.custom-scroll-width {
max-height: 0vh;
overflow-y: visible;
overflow-x: visible;
width: 180px;
}

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

Option tag for a sub-menu

I'm currently working on an application that requires a submenu within the option tag. The idea is that when a user clicks on one of the submenu options, it should appear in the search bar for searching purposes. Unfortunately, I'm facing some ch ...

I'm having trouble displaying the Facebook page plugin on my HTML website

I encountered a minor issue. I attempted to add the "Facebook page plugin" on a test website. I copied the code from the official Facebook plugin page: <!-- 1. Include the JavaScript SDK on your page once, ideally right after the opening <body> t ...

Adjusting font size to perfectly fit within its confines

When using v-for to map out objects from an array into cards, it's important to keep the height consistent throughout the section. Manually adjusting text size with @media queries can be tedious and inelegant, requiring multiple rules for different sc ...

Can the floated DIVs be prevented from breaking onto a new line if they exceed the container's width?

Take a look at this sample HTML code: <div id="container" style=""> <div id="left" style="float: left; width: 200px;">...</div> <div id="right" style="float: right; width: 100px;">...</div> </div> How can we prevent ...

Programming the action of unfolding one window while simultaneously closing all others

I am facing an issue where the foldout function is working perfectly, but I need the second function to run first in order to close all other elements. Unfortunately, I can't seem to figure out what the problem is. Any help would be greatly appreciate ...

Can the value in a JavaScript object be updated dynamically when a button is clicked?

In my JavaScript code, there is an object named annualPlan. Whenever a user submits the HTML form for a specific month, I aim to update the value in the object for that particular month accordingly. For instance, if someone submits August 21 and 200, I w ...

Issues with CSS styling inheritance in Angular components

I'm facing an issue with a button that is part of an InfoWindow component. The button is not created in the HTML code directly but is called whenever the card component opens. I have integrated this InfoCard into two different sections of the applicat ...

What are the benefits of initializing my Angular2 reactive form in the constructor instead of ngOnInit?

According to several responses, it is recommended to initiate the initial functions of an Angular2 application within the ngOnInit() method, reserving the constructor specifically for dependency injection tasks. However, the Reactive Forms tutorial I am c ...

Experiencing discrepancies in pixel height while conducting tests using Nightwatch

Let me start by sharing some details about my machine setup: Operating System: CentOS 7 Graphics Drivers: kmod-nvidia (dedicated GPU) I am currently testing a webpage using Nightwatch, and one of the requirements is to ensure that a background image&apo ...

What is the proper way to input a valid path?

I am facing an issue with the path to the CSS folder in the linked picture. The HTML code is working fine, but the CSS seems to be not loading correctly. I suspect that the problem lies in the path. How can I rectify this? I'm unsure of what steps to ...

Updating reactive form fields with patched observable data in Angular

Struggling with initializing a reactive form in my component's onInit() method, as well as handling data from a service to update or create entries in a MySQL table. The issue lies in using patchValue to pass the retrieved data into the form: compone ...

Erase jQuery from the text

I am struggling with splitting or removing text from a filename. For example, if I have filenames like: 200726100_50-0002.JPG 230514008_60-0001.JPG The desired result should be: 230514008_60.JPG 200726100_50.JPG Am I not using the split function cor ...

What is the best way to increase the height of an image in a grid container beyond the height of

I am currently designing a grid layout to showcase recent articles. Each article includes an image and a brief description. My goal is to have the image taller than the content text block, while ensuring responsiveness across various screen sizes. Below i ...

Looking for assistance with CSS to properly align a dozen items

UPDATE: See the current layout in this JFiddle based on feedback received from others, still a few tweaks needed. In my setup, there are 12 divs housed within one container div. These 12 divs consist of 6 text components and 6 corresponding input fields. ...

Pasting a canvas over a div using CSS

My website features a <div> containing creatively styled rings with a design reminiscent of the android unlock pattern. The div showcases 9 dots that can be connected in various configurations. I'm looking to overlay a canvas on this setup to tr ...

Implementing data binding in ngStyle with Angular

Having trouble binding data with Angular 8, I attempted the following method: <div class="speed" style="background-image: url('http://example.com/assets/images/meter.png')" [ngStyle]="{'--p':result.percentage}"></div> The ...

Can you explain the purpose of :not(style) ~ :not(style) in CSS?

Upon investigating, I found that Mui automatically included a :not(style) ~ :not(style) selector which required the use of !important in my sx to override. .css-1rb8ayf-MuiStack-root > :not(style) ~ :not(style) { margin-top: 40px; } .css-d13d9m-MuiSta ...

Issues with select options not functioning correctly in knockout framework

Currently, I am engaged in a project where data is being retrieved from an API. The main task at hand is to create a dropdown list using select binding. In order to do so, I have defined an observable object to hold the selected value within my data model. ...

A self-destructing javascript/jquery function that removes itself after running

For a very detailed analytics insight, I am sending an ajax request to my controller in order to update the user's interaction (such as which pages they visit or like) and store this information in my MongoDB. All I want is for this script to be dele ...

What is the best way to make a JavaFX WebView the same size as the entire scene?

My goal is to have a JavaFX WebView that automatically resizes to fit the scene upon startup. Currently, I am focused on setting the initial size properly. @Override public void start(Stage stage) { try { Scene scene = new Scene(createWebViewP ...