The submenu fails to open when a scrollbar is added to the menu

We have a wide variety of options on our menu, so we've added a scrollbar to make it easier to navigate. However, the sub-menus aren't expanding as they should because of the scrollbar.

   <div id="navbar3" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav" id="menus-list">
                        <template is="dom-repeat" items="{{menuItems}}">
                            <template is="dom-if" if="{{!item.subMenuItems}}">
                                <li>
                                    <a href='{{item.url}}' menu-url="{{item.url}}" on-click="handleMenuItemClick">{{item.name}}</a>
                                </li>
                            </template>
                            <template is="dom-if" if="{{item.subMenuItems}}">
                                <li class="dropdown">
                                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{item.name}}<span class="caret"></span></a>
                                    <ul class="dropdown-menu scrollable-menu">
                                        <template is="dom-repeat" items="{{item.subMenuItems}}">
                                            <template is="dom-if" if="{{!item.subMenuItems}}">
                                                <li><a href='{{item.url}}' on-click="handleMenuItemClick" menu-url="{{item.url}}">{{item.name}}</a>
                                                </li>        
                                            </template>
                                            <template is="dom-if" if="{{item.subMenuItems}}">
                                                <li class="dropdown dropdown-submenu">
                                                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown">{{item.name}}<span class="caret-right pull-right"></span></a>
                                                    <ul class="dropdown-menu">
                                                        <template is="dom-repeat" items="{{item.subMenuItems}}">
                                                            <li><a href='{{item.url}}' on-click="handleMenuItemClick" menu-url="{{item.url}}">{{item.name}}</a></li>
                                                        </template>
                                                    </ul>
                                                </li>
                                            </template>
                                        </template>
                                    </ul>
                                </li>
                            </template>
                        </template>
                    </ul>
                </div>

Here's the CSS code that might be affecting it:

.scrollable-menu{
                height: auto;
            max-height: 400px;
            overflow-x: hidden;
            }   

The scrollbar functions correctly, but the issue lies with the sub-menus not opening up. We're open to suggestions on how to address this problem.

Answer №1

Give this a shot:

.scrollable-list
{
    overflow-x: auto;
    max-height: 400px;
}

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

unable to view the contents of the template using the directive

I am facing an issue with the Directive, as it is not adding an element to the Template. This directive has been included in the .html file. There are no errors being displayed in the console. directive.js: app.directive('myDirective', function ...

divs aligned vertically on opposite edges of the webpage

Our web app is being embedded in a third party page as an iframe, but we need to add a bottom "toolbar" with 2 links. One link should be plain text and the other should display our company logo preceded by some text. We want the two links to be positioned ...

Obtaining data from console.log and showcasing it within a div element

Currently, I am facing a challenge where I want to retrieve the title, plot, and poster using the themoviedb API. However, I am lost on how to begin coding this. Whenever I perform a search, the information is displayed in the console log of the browser. ...

Is there a way to eliminate the default arrow on a list input and replace it with a custom arrow solely with html and css?

Is there anyone who can help me figure out how to remove the default arrow in the list input field and replace it with a new arrow icon? <body> <form > <label for="data-list">Choose a browser from this list &l ...

The link-dark bootstrap class fails to have an impact

As a beginner in using bootstrap, I am creating my first simple website. However, I am facing an issue with the footer copyright section where the class "link-dark" is not taking effect. <!-- Copyright --> <div class="container-fluid ...

Is there a way to adjust the offset in vue-scrollto specifically for mobile devices to ensure proper alignment?

I've been using the amazing vue-scrollto in combination with bootstrap and everything works perfectly on desktop, but there's an issue on mobile. The heading is not positioned correctly at the top of the screen. I tried adding padding to the head ...

Having issues with the Jquery Qrcode Function not functioning properly when placed inside a timeout

I'm feeling a bit lost while trying to implement Jquery QRCODE. I want to create a modal using Bootstrap 4 that displays a QR code image. When I use the code like this, the QR code image shows up: <script> $('#qrcode').qrcode('12 ...

Is there a way to remove the jQuery .css() upon clicking a different button?

I am currently working on a jQuery switch where I want the clicked button to revert back to its original state when another button is clicked. Additionally, I want the 'OFF' button to be automatically clicked first when the page loads. Despite tr ...

Use an external javascript file in AngularJS if permitted

To ensure that my HTML page only loads an external JavaScript file when the variable $scope.jsallowed is set to true, I attempted the following code implementation within my AngularJS based page: <script src="assets/js/slider.min.js" data-ng-if="jsallo ...

Change all lowercase characters to uppercase in the font file

: I recently created a .ttf font file, but unfortunately only included capital characters. Is there a tool or simple method I could use to automatically create lowercase versions of each letter? For instance, when typing "hello" the font should display ...

The solution for the fixed-top navbar issue in Bootstrap is not resolved with padding-top

My navigation bar is covering up my content. I've tried adding padding-top and ensuring that the custom.css file loads after the bootstrap css, but it's still not working. In my Django project, I'm certain that the custom.css file is being l ...

Is there a way to display the JavaScript widget exclusively on the homepage or main page

How can I limit the display of a Twitter widget on my blog page to only show on the main page and hide it when visitors navigate to sub-pages or individual blog entries? ...

Images are not loading properly on the website when viewed on an iPad

As I work on my website with a parallax effect, I recently came across an issue: images not displaying on iPod devices. Unfortunately, since I don't have access to an iPod, I am unable to verify this myself. Can anyone explain why the main pictures ar ...

Incorporating an image as a clickable element instead of a traditional button using HTML and

Here's the issue at hand: I currently have "+" and "-" icons at the end of each row to add and delete rows as needed. However, I would like to replace the "-" icon with a trashcan symbol instead. I attempted to do this by replacing it with an image s ...

Tips for creating a stored procedure that takes a drop-down list selection as an input and transfers the outcome to an empty text box

I have successfully executed my procedure in SQL Management Studio, but I am facing issues running it in Visual Studio. When I try to run it in Visual Studio, I am unable to select the input parameter. I would like to run it in a way where the input parame ...

Modifying the background hue of the element-ui tooltip

I am currently working with vue.js version 2.6.10 and element-ui version 2.15.1. The element-ui component I am using is as follows: <el-tooltip content="Top center" placement="top"> <span>Dark</span> ...

Altering documents post Bower installation

I took the initiative to manually download the css and js files for an angular module (here). In order to make a small adjustment, I modified the css (specifically changing max-width in the media query): Original: @media only screen and (max-width: 800px ...

Saving a Session Variable when a button is clicked in HTML and PHP

I'm struggling with storing Session variables when a button is clicked. I want to achieve this without using a form. Below is the code I currently have for my HTML and PHP. <?php session_start(); if(isset($_GET['oldsignin'])) { $user ...

Javascript code for toggling the visibility of a div element not functioning as expected

This problem is becoming quite frustrating as it appears to be straightforward but still doesn't work. Inside my document, I have <div id ="splashscreen" style="display:block"> <h3>title</h3> <p>text</p> &l ...

css background-size and image position not working

On my website, users/members can upload or link a custom image for the start page. This feature works well with modern browsers that support background-size in CSS. However, if the browser does not support css3 background-size, the image may not fill the e ...