Implementing iOS scrollbars as a solution for the Bootstrap 4 Carousel Bug that triggers extra swipes with just a click or tap

The issue & environment

Utilizing Bootstrap 4 via CDN, a problematic scenario has arisen with the Carousel feature on iOS devices. An identified bug persists in this aspect of Bootstrap, acknowledged with a potential resolution available through github #28558; however, this fix remains unreleased. Though introduced as of 27 March, we await the arrival of Bootstrap v4.4.0, housing the solution, which is regrettably devoid of any firm release date.

A brief summary of the cause

Post-SWIPE interaction on iOS devices triggers an anomaly within Bootstrap's carousel.js, failing to reset an essential internal parameter (touchDeltaX). Consequently, ensuing taps or clicks inadvertently lead to additional undesired swipes.

The proposed fix

An observation suggests that engaging a vertical touch maneuver to prompt scrollbar visibility appears to nullify the said undesirable action, hinting at a plausible workaround.

Initially assumed as a straightforward task, potentially requiring minimal code adjustment, the implementation seems to have hit a snag. The challenge lies in programmatically manipulating scrollbars specifically on iOS devices.

  function scrollY() {
    if (hasTouchscreen){
       window.scrollBy(0,1);
       window.scrollBy(0,-1);
     }
  }

A functional CodePen (referenced below) illustrates our simplified test case. Despite slight modifications for compatibility within the CodePen environment, complete functionality mirroring our development setting remains elusive. Nonetheless, successful operation observed on iOS devices, effectively highlighting the unresolved bug awaiting a viable workaround.

How to reproduce the issue (iOS)

To simulate the glitch, engage the PLAY/PAUSE/STOP buttons before navigating using the carousel controls (NO swiping!). Subsequently, repeat the process, opting for swipe gestures instead of the control buttons. The aftermath reveals an inadvertent repetition of the last swipe direction upon interacting with the PLAY/PAUSE/STOP functions.

The "manual" workaround (which works!)

Prompted by empirical evidence suggesting a vertical gesture alleviates the issue post-horizonal swipe actions: attempt a vertical swipe following a horizontal one to observe temporary scrollbar activation. This intervention prevents further undesired swipes when interacting with the aforementioned buttons, though impractical for live implementation due to user experience considerations.

Tried so far

Concluding the JavaScript segment, the function scrollY() executes window.scrollBy(0,1); and window.scrollBy(0,-1); with intent to manipulate scrollbars. Albeit effective in testing environments, iOS fails to reflect similar alterations within its scroll interface.

Note: Observable behavior confirms the routine efficacy within test scenarios, where each swipe illuminates the scrollbars fleetingly, contrasting non-illumination linked to control button usage!

​​Exhaustive searches across platforms like StackOverflow yielded no tangible solutions addressing the dilemma - persisting complexities prevent me from resolving this matter :(

[ Code & req result ]

CodePen:

Bootstrap carousel with embedded YouTube videos + control buttons & touchswipe

Note: While this CodePen effectively operates on iOS devices, anomalous behavior surfaces concerning the functionality of PLAY/PAUSE/STOP buttons within our desktop testing realm. However, the incongruity appears exclusive to CodePen, proving insignificant given the apposite performance witnessed on intended iOS platforms.

Required result

Innovative measures are requisite to instigate programmatic recalibrations within iOS scrollbars, thus facilitating a course correction for Bootstrap's carousel.js. These endeavors aspire to circumvent existing bugs persisting until the eventual rollout of Bootstrap v4.4.0 (or v5).

Answer №1

Exciting news - Bootstrap version 4.4.0 has been officially launched, resolving the prior concern.

I was hoping to uncover a way to dynamically manipulate iOS scrollbars programmatically. If anyone possesses insights on this matter, please feel free to share even though I am concluding this discussion.

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

Choosing a specific column in an HTML table using jQuery based on the text within it

I have a table with a similar structure as shown below: <table> <c:forEach ...> <tr> <td>test</td> // this is the initial value <td>random value</td> <td>random value</td&g ...

Expanded MUI collapsible table squeezed into a single cell

I'm experimenting with using the MUI table along with Collapse to expand and collapse rows. However, I've noticed that when utilizing collapse, the expanded rows get squished into one cell. How can I adjust the alignment of the cells within the p ...

Having trouble receiving a response from an API built using Express.js and SQL Server

Currently, I am in the process of learning how to create an API using Node and Express.js. I came across a step-by-step guide that has been very helpful. You can check it out here. I've followed the instructions provided and created a similar version ...

Troubleshooting: Discord bot failing to initialize on Heroku

After successfully hosting my bot on Heroku for a while, I temporarily switched back to self-hosting to update to discord.js v13. Now that I'm done with the updates and trying to re-host the bot on Heroku, I'm encountering this error: (node:4) Un ...

Exploring the capabilities of Vue.js, including the use of Vue.set()

Just starting out with Vuejs and I have a query regarding the correct approach to achieve what I want. My Objective I aim to have some dates stored in an array and be able to update them upon an event trigger. Initially, I attempted using Vue.set, which ...

Saving received JSON data from fetch() API request into a variable

Just starting out with JS and currently working on a project involving retrieving data from an API using a JS Notebook. I'm trying to create a function that can make API calls based on a given URL, and then execute that function twice. The objective ...

Is it necessary to contain every element within a row and column in the Foundation or Bootstrap grid system?

I have been exploring both Foundation and Bootstrap frameworks lately. A theoretical question came to my mind - do I always need to place each element inside .row>.column (for Foundation) or .container>.row>.col-- (for Bootstrap), even if I don&ap ...

Docusaurus font loading specifically optimized for body text, excluding headings

I've added the following CSS code to my Docusaurus custom stylesheet: @import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"); :root { --ifm-color- ...

Exploring the benefits of utilizing ng switch for more effective validation

Visit this link to see the code My goal is to display error messages one after another. I am considering using ng switch instead of ng:show for better efficiency, but my current approach is not working as expected. <div class="errorDiv" ng-switch on=" ...

Tips for filtering data using an array within an object containing arrays

Below is the provided information: userRoom = ['rm1']; data = [{ name: 'building 1', building: [{ room: 'rm1', name: 'Room 1' },{ room: 'rm2', name: ' ...

Instructions for implementing tooltips on a pie chart slice when hovering with the mouse pointer, using the canvas

var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var cw = canvas.width; var ch = canvas.height; ctx.lineWidth = 2; ctx.font = '14px verdana'; var PI2 = Math.PI * 2; var myColor = ["Gr ...

A step-by-step guide on extracting nested ASP.NET DataGrid values with JavaScript

Looking to retrieve data from a nested data grid on an aspx page using JavaScript. Check out the following code snippet: <tr> <td colspan="2" align="center"> <asp:DataGrid ID="sampleData" AutoGenerateColumns="false" runat="serv ...

How can I convert a UTC time field from MySQL into JavaScript?

I'm struggling to pinpoint the error in my date/time difference calculations. It seems to be related to timezone variations, but I can't figure out exactly where the problem lies. Below are all the components involved - can you help me identify t ...

Action outcome yielding identical content

Is there a way in MVC C# to return an ActionResult without making any changes to the view? I have attempted: Returning null and new EmptyResult(), but these result in an empty page Returning an empty JavaScript (again, resulting in an empty page) Retur ...

Discovering the exact moment a user chooses a different answer in a quiz application using React

I'm currently developing a Quiz App that retrieves questions and answers from an API. My goal is to implement a feature that checks if the user selects the correct answer, their score increases by 1. However, if they change their mind and choose a wr ...

There seems to be a caching issue in ReactJS and Spring Data Rest that could be causing problems with

Encountering an unusual caching problem here. Just recently wiped out my database. While adding new users to the system, an old user mysteriously reappeared. This user has not been recreated and is not in the current database whatsoever. I'm at a lo ...

VueJS effects when elements are added and removed

I'm currently diving into VueJS and struggling to tackle this issue with transitions. My project includes two components - ComponentA and ComponentB. Let's take a closer look at them: ComponentA: <template> <div id="ComponentA"> ...

Guide to periodically updating and displaying a <b-img> element in VueJS

Recently delving into the world of JS and Vue. Within my Bootstrap-Vue project, there's an image element that looks like this: <b-img src="/api/camera" fluid alt="camera"></b-img> Whenever the page is refreshed, the br ...

Issue: When setting the `tintColor` property of `UITextField.appearance()`, it causes the color of the

For some reason, this particular code snippet is causing an issue for me: UITextField.appearance().tintColor = Colors.orange It's causing my rightBarButtonItem to turn blue, even though I have it set to orange elsewhere in my code. I did some testi ...

AJAX allows developers to declare variables within their code to

Here is a snippet of my JavaScript code: $(\"img.agree\").click(function() { var follow_id = $(this).attr(\"id\"); var user_id = $(\"img.user_id\").attr(\"id\"); $.ajax({ type: \"POST& ...