Enable scrolling for a div that contains ng-repeat items

Here is the HTML code snippet I am working with:

 <div id="header_context" class="scroll">
    <div id="column_scroll" class="column" ng-repeat="column in columns track by column.name" ng-hide="column.name == 'date'" ng-click="column.visible = !column.visible">
        <div class="checkmark" ng-class="{'checked': column.visible}"></div>
        <div class="" ng-bind-html="column.title"></div>
    </div>
</div>

This shows a portion of my CSS styling:

#column_scroll{
  overflow: scroll;
}
.scroll{
  overflow: scroll !important;
}

Within my JavaScript file, there is a function that looks like this:

  $('#timeline_container #content .trips_header').on('contextmenu', function(e) {
    e.preventDefault();
    e.stopPropagation();
    hideContextMenu();
    $('#header_context').css({
        display: 'block',
        left: e.clientX,
        top: e.clientY,
        overflow:scroll
    });
    $('#header_context > div').click(function(evt) {
        evt.stopPropagation();
    });
});

When inspecting, this is what is visible:

In some cases, such as on a PC or when the inspector is not open, it appears as follows: However, with the inspector enabled or on a laptop, it may look like this:

Clearly, there seems to be an issue where the list does not fit properly and is not scrollable as intended.

Answer №1

It appears that a piece of html code is missing. In order for the content to be scrollable, you must specify a height or max-height attribute for the "header_context" div or any other div that will contain the ng-repeat items. Then set it to "overflow-y:scroll;" This way, if the height of child ng-repeat divs exceeds the parent's height, the parent will become scrollable.

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

The difference in pixels for absolute positioning fluctuates by 1

I want to create a unique design for my website where there is a single fixed background at the top center. I also have some specific elements that, when hovered over, should show a different background that aligns perfectly with the original one. The fun ...

How can I retrieve the SID received in a different tab using MSAL.js?

I have successfully integrated MSAL into a client-side library, and things are going smoothly so far. My next goal is to enable Single Sign-On (SSO) by following the instructions provided in the documentation at https://learn.microsoft.com/en-us/azure/act ...

Using jQuery to serialize parameters for AJAX requests

I could use some help figuring out how to set up parameters for a $.ajax submission. Currently, I have multiple pairs of HTML inputs (i pairs): > <input type="hidden" value="31" name="product_id"> <input > type="hidden" value="3" name="qua ...

Tips for exporting 3D objects from 3ds Max Studio for optimal use in Three.js

I am facing an issue with loading a 3D object that I created in 3D Studio Max! When I export it as a .obj file (which generates two files, .obj and .mtl), I have tried using OBJMTLLOADET(), MTLLOADER(), and OBJLOADER() but none of them seem to work. Other ...

Styling Angular Material Forms: Customizing Input Backgrounds and Button Heights

I'm currently working on a simple email input form with a submit button. Here are the adjustments I want to make: Set the background of the email input to white Ensure that the submit button matches the height of the input field However, my attempts ...

Tips for incorporating tabs into a Rails 3 application with the help of Sass/Haml or CoffeeScript

Currently, I am looking to implement tabbed views in a project I am developing using Rails 3. To ensure compatibility with the latest features of Rails, I have decided to utilize Sass and CoffeeScript as my primary tools. If anyone has any resources or tu ...

Sending a JavaScript value to PHP after a quiz has been completed

I've created a web page where users can take quizzes. These quizzes dynamically generate questions using JavaScript each time they are accessed. Disclaimer: I'm fairly new to JavaScript. Once the user completes the quiz, they receive their fina ...

Tips for looping through an array of objects and summing their attributes

Here we have an array of objects as an example: [{Name: Deji, Age: 12}, {Name: Sonia, Age: 13}, {Name: Fabio, Age: 21}] I am curious about how to loop through this array in order to calculate the total age of all the people included. Is there a specific ...

Problem with the content-editable attribute

My goal is to make each div with the class .edit editable by adding the contenteditable property: $(document).ready(function() { $(".edit").attr("contenteditable", "true"); }); However, after applying this, I found that clicking on a div with content ...

Node.js encountered an error due to a self-signed certificate within the certificate chain

I'm encountering an issue with client-side HTTPS requests. An example snippet is as follows: var fs = require('fs'); var https = require('https'); var options = { hostname: 'example.com', port: 443, path: & ...

When the 'keyup' event is detected, trigger the function only on keyup

Looking for assistance in setting this to only trigger on keyup events. Can anyone provide guidance? $(function() { $('#acf-field_5a32085c7df98-field_5a3208f87df99').on('keyup', function() { $('#link-headline-fb').text($( ...

Attempting to invoke selectize with an alternative parameter, however, it persists with the previous value

Trying to debug a function that takes a parameter and utilizes selectize.js. Initially, the function myFunc is called with a parameter value of 1. Everything works smoothly as data is fetched from the server and displayed in a dropdown list. However, upo ...

Discover the key technique to modify the status of a different component in React

I'm working on developing a popup window component. Here is the initial code for the popup component: The component takes in two props, activity (which can be set to true or false) and content (a view component that will be displayed inside the popu ...

Creating a PDF document using HTML code

I am interested in creating a PDF file from an HTML code that includes the stylesheet rules using PHP. Currently, I am attempting to achieve this with the MPDF library. However, the generated PDF does not resemble the original HTML page. Many elements app ...

The function $location.path in Angular is failing to function as expected

Struggling with an issue in Angular using Web API. When I try to navigate to the home page using $location.url("/home"), the page doesn't display. Upon checking the URL in Chrome's development tool, I found a link to http://errors.angularjs.org/1 ...

Tips for effectively managing missing translation files when utilizing the AngularJS static file loader

When using multiple rules in the definition of your useStaticFilesLoader, if one of them is a folder that cannot be found, Angular Translate will fail even if the translations within those missing files are not being utilized. For example, if you mistaken ...

how to put an end to sequential animations in React Native

Is there a way to pause a sequenced animation triggered by button A using button B? Thank you for your help! ...

Incorporate Three.JS into Meteor for enhanced functionality

Currently, I am experimenting with integrating Meteor and Three.JS. The specific meteorite package for Three.JS that I am utilizing can be found here: https://github.com/nozpheratu/three-meteor. Despite being able to perform basic functions in Three.JS, I ...

What is the method for retrieving the locale value from the configuration in Next.js?

How can I retrieve the i18n.defaultLocale value from my Next.js app configuration? I thought it would be simple, but I'm struggling to find a clear solution for accessing the config settings in Next.js. Is there a specific built-in method for this, or ...

Proxy/firewall causing interference with socket connection from chrome extension

I have encountered an issue with my web app in JavaScript that connects to a socket using socket.io and a Chrome Extension that also connects in the same way to the same server. While everything works smoothly on most computers and internet connections, th ...