Encountering iOS 10 freezing issues when scrolling through an HTML list that is styled with -webkit-overflow-scrolling: touch

Overview

This specific issue pertains to a potential freeze that occurs when scrolling through a <ul /> element that has been styled using CSS, specifically with the property

-webkit-overflow-scrolling: touch
on the Safari browser of iOS.

Related Problems

I have come across similar concerns or discussions on this topic:

Issue with freezing when using -webkit-overflow-scrolling

Scrolling bug in iOS 9 with `-webkit-overflow-scrolling: touch` and `overflow: scroll`

CSS bug with Webkit overflow scrolling touch on iPad

Visit this link for potential solutions

and so on.
I am still uncertain about which solutions would address my specific problem.

HTML and CSS Setup

I have provided the index.html file along with index.css, both of which were tested on the latest iPad model.

These files are quite simple, with index.html containing a single <ul /> list with 50 items, enclosed within a

<div class="container">
.

Identifying the Issue

To recreate the issue, you can follow these steps:

  1. Scroll down the list until reaching the bottom

  2. Once the side bar disappears, attempt to scroll further downwards

  3. Then, try moving your finger in the opposite direction to go back up

  4. Notice that the initial upward movement of your finger may not respond

  5. After a few moments, you should be able to scroll back to the top

To better illustrate this issue, I have uploaded a video on YouTube showcasing the problem on an iPad:

Check out the video demonstrating the issue
View the YouTube video here

Specifically, the problematic step 4 from the above procedure can be seen around the 8-second mark in the video.

Please note that the iPad used in the video:

  • iPad 9.7inch (latest model)
  • iOS 10.3.2
  • Running Safari browser

Seeking Solutions

Could you kindly assist me in answering the following questions:

  • Why is step 4 of the procedure experiencing issues?

  • How can I adjust the HTML or CSS to improve smooth scrolling of the list?

Sample Code

You can access the sample code used in the YouTube video on GitHub.
Here is the link to the repository:

GitHub Repository Link

Please note that this sample program requires Node.js to run the server.

Thank you for your assistance.

Answer №1

If you're looking to work around the scroll lock issue, one potential solution is to trigger a minimal scroll movement of one pixel when the list reaches the top or bottom.

Take a look at this simple example:

PS Another option to address this could involve utilizing overscroll-behavior, but this method is dependent on iOS 16.

const list = document.querySelector('.list');

list.addEventListener('scroll', onePxHack, { passive: false })

function onePxHack(e) {
  const { currentTarget: list } = e
  const atTop = list.scrollTop === 0;
  const atBot = list.scrollHeight - list.scrollTop === list.offsetHeight;
  if (atTop || atBot) {
    list.scrollTop += atTop ? 1 : -1;
    e.preventDefault();
  }
}
.container {
  background-color: #DDD;
  width: 300px;
  height: 500px;
  position: fixed;
  top: 0;
  left: 0;
  margin-top: 50px;
  margin-left: 50px;
}

.list {
  height: 500px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 24pt;
  padding: 0;
  margin: 0;
}

.list>li {
  list-style-type: none;
}
<div class="container">
  <ul class="list">
    <li>001</li>
    <li>002</li>
    <li>003</li>
    <li>004</li>
    <li>005</li>
    <li>006</li>
    <li>007</li>
    <li>008</li>
    <li>009</li>
    <li>010</li>
    <li>011</li>
    <li>012</li>
    <li>013</li>
    <li>014</li>
    <li>015</li>
    <li>016</li>
    <li>017</li>
    <li>018</li>
    <li>019</li>
    <li>020</li>
    <li>021</li>
    <li>022</li>
    <li>023</li>
    <li>024</li>
    <li>025</li>
    <li>026</li>
    <li>027</li>
    <li>028</li>
    <li>029</li>
    <li>030</li>
    <li>031</li>
    <li>032</li>
    <li>033</li>
    <li>034</li>
    <li>035</li>
    <li>036</li>
    <li>037</li>
    <li>038</li>
    <li>039</li>
    <li>040</li>
    <li>041</li>
    <li>042</li>
    <li>043</li>
    <li>044</li>
    <li>045</li>
    <li>046</li>
    <li>047</li>
    <li>048</li>
    <li>049</li>
    <li>050</li>
  </ul>
</div>

Answer №2

One workaround for this problem involves utilizing the body's scroll. However, this solution is only applicable to specific scenarios.

Answer №3

Customize your CSS styling

overflow: hidden;

Alternatively,

overflow: auto;

Implement CSS @media queries to adapt to various screen sizes

Answer №4

Implement @media rules to adjust content for different screen sizes. Here is an example:

@media screen and (min-width: 900px) {
  article {
    padding: 1rem 3rem;
  }
}


@supports (display: flex) {
  @media screen and (min-width: 900px) {
    article {
      display: flex;
    }
  }
}

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

Styling text and images with Bootstrap

Currently, I'm utilizing bootstrap to structure a row with 2 div elements. The first div contains an image while the second div holds text content. The challenge I am facing is aligning the text to the edge of the image. However, since the image does ...

Having trouble retrieving the value of a textarea within a jQuery UI dialog box

I attempted to place a textarea within a dialog box, with the intention of retrieving the value of that textarea when the "ok" button is clicked. However, I am encountering difficulties in retrieving the value. What could possibly be causing this issue? ...

What is causing the classList function to throw an error: Uncaught TypeError: Cannot read properties of undefined (reading 'classList')?

There's an error that I can't figure out: Uncaught TypeError: Cannot read properties of undefined (reading 'classList') console.log(slid[numberArray].classList) is working fine, but slid[numberArray].classList.add('active') is ...

Exploring intricate designs using HTML and Javascript

After extensive experience with both WPF and HTML5 JavaScript, one thing that stands out to me is the clear organization provided by XAML's defined panels. Grid, StackPanel, DockPanel, WrapPanel, and others offer a straightforward way to achieve consi ...

Is there a way to format a block of text so that right-to-left text aligns to the right, while left-to-right text aligns

I have a content block that includes text in both left-to-right and right-to-left languages, and I need to ensure that both display correctly. If the user begins with left-to-right text, it should be displayed from left to right with left alignment If the ...

Is it possible to include the contents of an .ics file and provide a link to it in HTML, all without relying on JavaScript?

The content of an .ics file is quite simple: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//appsheet.com//appsheet 1.0//EN CALSCALE:GREGORIAN METHOD:PUBLISH BEGIN:VEVENT SUMMARY:Invitation from <<USEREMAIL()>> to talk about <<[MeetingTopic]>> ...

Utilizing Ajax and Jquery to dynamically adjust CSS properties, dependent on data from a specific MySQL row

I've been working on a system to automatically update a Scene Selection page whenever a new number is added to the permission table in Mysql. The PHP for the login and retrieving the number from the members table is working fine. My issue now lies wi ...

How can a div be positioned outside of an overflow scroll without resorting to absolute positioning?

I am currently designing a blog theme and I would like to include a small box that displays the post date offset to the left of each post, similar to this mockup: My issue arises because the post container has overflow scrolling enabled, making it difficu ...

How can we programmatically trigger a click action on an element obtained through an HTTP request with the help of Set

window.addEventListener("load" , () => { setInterval(() => { let xhttp = new XMLHttpRequest(); xhttp.open("GET", "./messagedUsers.php", true); xhttp.onload = () => { if(xhttp.re ...

What could be causing my ng-grid footer to refuse to align with the bottom border?

Currently utilizing ng-grid and various AngularJS UI Bootstrap components on my website, I have encountered a recurring issue. By diligently investigating, I have successfully replicated the problem. Access the Plunker demonstration through this link. The ...

Utilize jQuery to apply a border and background color to a table row when hovering over it

Is there a way to change the border of a table row along with its background color when the mouse hovers over it? Currently, I can only modify the background color using the following code: $(document).ready(function() { $(function() { $(&apos ...

jQuery Summation: A Step-by-Step Guide

Hello everyone, I am a new member of this forum and I am looking forward to learning and contributing with all of you. I have encountered a problem that I tried to solve on my own but couldn't figure it out. Would anyone be able to lend me a hand? H ...

How to Align Title in the Center of a Section Containing Multiple Images?

I have a situation where I am using a StyledHead section to display 10 images from an API. The images are wrapped in another section called StyledHeader, which also contains an h1 element. How can I center the h1 element both vertically and horizontally so ...

AngularJS Filter from "start to finish" in values

I have been searching everywhere for a solution to this problem, but haven't found one yet. Any help would be greatly appreciated. Angular: var app = angular.module('app', []); app.controller('theController', ['$scope', ...

`Cannot locate the CSS file on my local server`

My Node.js application uses the Express.js framework, and I am attempting to execute the following code: app.use('/public', express.static(path.join(__dirname,'public'))); However, I encountered the following error message: The CSS ...

Steps to turn off a Material UI CSS class for an element universally

Utilizing the Material UI Typography element with the css class MuiTypography-h1, I am seeking to globally disable its usage throughout the entire codebase. <Typography variant="h1" sx={{ width: '100px', height: '55px ...

Perform an AJAX request to an encrypted URL with an unverified certificate

I'm experiencing an issue with my site that makes AJAX JSONP calls to a secured (SSL) web server. Everything works smoothly when using an unsecured (HTTP) web server, but once I switch to the SSL version, the call never returns. After checking with Fi ...

Error encountered during the compilation of Kivy for iOS - Python recipe not found

The Issue: macbook-MacBook-Pro:test2 macbook$ toolchain create Buttonis ~/Volumes/EFE/test2 [ERROR ] No python recipe compiled! [ERROR ] You must have compiled at least python3 [ERROR ] recipe to be able to create a project. I'm trying to creat ...

Create a footer with a centered column orientation

I am currently working on creating a footer with four columns, one of which will display an image while the others will contain useful hyperlinks. This is what I have accomplished so far: http://jsfiddle.net/Lqh5a/ HTML <div id="wrapper"> <div ...

Redirecting and styling following an HTTP post operation

Implementing Stripe on my Firebase-hosted website. Utilizing a Cloud Function to handle the transaction. I have integrated the Stripe Checkout within a button displayed directly on my single HTML page, which then directs to the /charge function in inde ...