Infinite scrolling in AngularJS doesn't seem to be functioning properly when using Chrome in full

Currently, I am implementing an infinite scroll feature using ng-repeat and adjusting the limitTo value through a loadMore() function.

Below is the code snippet for the directive (discovered on a jsfiddle):

angular.module('scroll', []).directive('whenScrolled', function() {
    return function(scope, elm, attr) {
        var raw = elm[0];

        elm.bind('scroll', function() {
            if (raw.scrollTop + raw.offsetHeight >= raw.scrollHeight) {
                scope.$apply(attr.whenScrolled);
            }
        });
    };
});

The controller contains the following code:

var nb = 15;
$rootScope.vue = nb;
$rootScope.loadMore = function() {
    $rootScope.vue = $rootScope.vue + 5;
}

This is how it looks in the HTML:

<div class="container-fluid" id="full-2">

    <div class="row" id="full-3">
        <div class="col-xs-12 col-md-10" id="fixed" when-scrolled="loadMore()">
            <ul>
                <li ng-repeat="pg in eleves0 | search:query:['millesime']:operator | orderBy:orderProp | limitTo:vue">

                [...]

                </li>
            </ul>
        </div>
    </div>

Additionally, here is the CSS styling being used:

html, body{
    background-color:#ccc;
    height:100%;
}

#full{
    height:100%;
}

#full-1{
    height:90%;
}

#full-2{
    height:100%;
}

#full-3{
    height:100%;
}

#fixed{
    height:100%;
    overflow: auto;
}

This implementation functions smoothly on IE, Firefox, and Opera, where scrolling down reveals new content. However, it encounters issues on Chrome, particularly in full-screen mode or when the window's height exceeds a certain threshold (~300-500 px).

If you have any insights on the possible reasons behind this issue or solutions to resolve it, they would be greatly appreciated.

Answer №1

Exciting news! I discovered a resolution. change to :

#adjusted{
height:100%;
overflow: scroll;

}

This method is effective!

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

Separating MS Edge Driver into its own configuration file in wdio

Seeking assistance with creating separate configuration files for Chrome, Firefox, and Microsoft Edge drivers on webdriver.io (version 7.19.3). Struggling to configure the Microsoft Edge driver on a Windows 10 machine while maintaining the main wdio.conf.j ...

What could be the reason for a particular product edit page showing up completely blank?

In my ongoing project, I am developing an admin panel that allows administrators to add new products to their website. These products are then stored in a Firestore database and managed using Redux Toolkit. The added products can be viewed and edited in th ...

What is the best way to save PDF documents in a Mongo Database using NODEJS?

Is there a way to save PDF data in a mongo Database and convert it into base64 format? ...

Unable to move an element with Webdriver in Java Script

Trying to Drag an Element with the Following Code - "WebElement baseElement = driver.findElement(By.xpath("Element ID"); Actions clicker = new Actions(driver); clicker.moveToElement(baseElement).moveByOffset(20,0).click().perform(); Encount ...

Why are NodeJS and Jade/Pug variables not being recognized in the Jade script?

After successfully passing a variable to Jade like #{myvar}, I encountered an issue when trying to access it in a script block. Despite using typeof(myvar) and confirming that it was initially undefined, my attempts to display its value within the script b ...

Display the value on the screen based on the specified condition

Extracting the "address" value from the backend yields an uppercase result. To format it with only the first letters capitalized, I implemented a solution. However, an issue arises when the "address" value is missing. const capitalizeFirstLetter = (string) ...

Can ng-click be injected into an ng-bound HTML div in an Angular application?

In my controller, I am returning HTML using the following function: $scope.filterLocation = function(obj) { var loc = $filter('filter')( $scope.locationss, {'product_code': obj}); var htmlstring = ""; angular.forEach(loc, function(v ...

Transforming an array of objects into a new array containing the average numbers of each object

I'm working with an array that needs manipulation in order to use it as a data source for D3.js. The dataset looks like this: var data = [ {day: 1, month: 1, length: 100, year: 2010}, {day: 2, month: 1, length: 125, year: 2010}, {day: 3, mon ...

I am facing an issue in JavaScript where one of my two timers is malfunctioning

While working on my tank game, similar to Awesome Tanks, I encountered an issue with the AI tank shooting mechanic. I set up a separate timer for the AI tank to shoot a bullet, but when I attempt to run it, I receive an error stating that AItimer is not de ...

The CSS div gradually descends as I increase the width of the browser

I'm in need of assistance with creating a website specifically for mobile devices and tablets. The issue I am facing is that when I expand my browser width to a tablet size, the "loginD" div shifts downwards - view this gif Below is my HTML code: &l ...

Header cannot be set once they have already been sent

I'm having trouble setting the header in the code snippet below. Even though I've added a return at the end of each line, the res.json(data) seems to be executing twice. Can someone please correct me if I'm mistaken? Here is the content of ...

Display a container upon clicking a button if the field is valid

Having recently delved into the world of jQuery, I encountered a challenge with a plugin called jQuery Validate. Despite searching for examples on their website, none seemed to match my unique situation. After experimenting with different approaches, I st ...

Fixing the issue: "Tricky situation with JavaScript not working within Bootstrap 4's div tag while JS functions properly elsewhere"

Currently, I'm working on implementing a hide/show function for comments using JavaScript. Fortunately, I was able to find a helpful solution here (thanks to "PiggyPlex" for providing the solution on How can I hide/show a div when a button is clicked? ...

Utilizing slug URLs effectively in Next.js

In my current project with Next.js, I am working on implementing "dynamic routes". The goal is to update the URL structure such that upon clicking, the URL should look like "myurl.com/article/55". To achieve this, I have utilized the following "link tag": ...

Experiencing issues with AngularJS code when attempting to use two controllers simultaneously in a single form

Just starting out with AngularJS and I'm attempting to merge two ng-controllers together. Prior to this attempt, the initial selected drop down option was correctly chosen. However, now that I have combined the controllers, the drop down option desig ...

Create an object using a combination of different promises

Creating an object from multiple promise results can be done in a few different ways. One common method is using Promise.all like so: const allPromises = await Promise.all(asyncResult1, asyncResult2); allPromises.then([result1, result2] => { return { ...

Consider implementing a fixed position to the navigation bar

Currently, I am facing an issue with my menu layout as shown in this demo The problem arises when the menu goes outside of its container, similar to the image below: https://i.sstatic.net/nQA2K.png This issue occurs because I have applied position: fixe ...

Angular-maps-google search bar

I have a specific directory structure as follows: myFolder myApp.coffee index.html searchbox.tpl.html Within myApp configuration, I've set the following: $scope.searchbox = {template: "searchbox.tpl.html"} While trying to implement this example, ...

modify the navigation when router events are triggered

Is there a way to modify the destination route after the router events have been triggered in an Angular app? I am trying to implement a functionality where if the user clicks the browser back button, the navigation is redirected to the home page. However, ...

Retrieving the _id of a new document in MongoDB using Node.js

I am facing a challenge understanding MongoDB after transitioning from using relational databases. Currently, I am attempting to store an image with the following code: exports.save = function ( input, image, callback) { console.log('Image P ...