Unable to access vertical scrolling on mobile devices when utilizing a full-width PrimeNg carousel

One issue I have encountered is with a full-width carousel on a webpage where most of the page is taken up by the carousel. When viewing the page on a mobile screen and attempting to scroll vertically, the scrolling functionality does not work as expected.

To see this behavior in action, you can visit the following link and try scrolling on the image:

Answer №1

After much troubleshooting, I finally uncovered a workaround for this issue. By overriding the onTouchMove method, we were able to get the scroll functionality working again. It turns out that in the plugin's implementation of this method, the default event was being prevented.

import { Carousel } from 'primeng/carousel';
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})
export class AppComponent {

    constructor() {
        Carousel.prototype.onTouchMove = () => { };
    }
}

Answer №2

@sushil kumar's code is spot on, it works flawlessly!

constructor() {
    Carousel.prototype.onTouchMove = () => { };
}

Answer №3

Hey @Sushil Kumar, I wanted to express my gratitude for your helpful solution. Your suggestion really made a difference in my project. In order to comply with my linting rules, I decided to add strong typing to the override method. Here is how my updated code looks:

Carousel.prototype.onSwipe = (): void => undefined;

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

Creating the Apk file for your sencha touch application

Hello there! I'm diving into the world of Sencha Touch as a new user. After installing all the required tools and SDK, I successfully set up the demo example that came with project creation via command line. Now, I'm eager to generate the APK fil ...

What is the best way to find the Selenium Webdriver element for the following HTML/jQuery snippet?

After numerous attempts with xpath, I am consistently encountering the noelementfoundexception error. My next strategy is to attempt clicking on Section 2. ...

Activate the function within the same class only for the selected item

Hello there, I'm struggling to grasp how to make this particular functionality work. Basically, I have 8 divs, each containing an image used as a button with the same class (tm-img), and hidden divs with additional information. My goal is to initiall ...

Finding a particular CSS3 Keyframe using JavaScript

Is there a way to detect when an animation reaches a specific keyframe, like 50% or 75%? I attempted the following: element.addEventListener("animationend", AnimationListener, false); However, this only supports animationstart, animationiteration, and a ...

Troubleshooting directive not functioning properly with AngularJS ng-click

My HTML img tag is not responding to ng-click when clicked. I'm puzzled by this issue occurring in masonryPictureView.html Main page - home.html <ng-masonry> <ng-picture ng-items="projectdescription.pictures"></ng-picture> </n ...

Troubleshooting CSS Display Problem on Chrome and Firefox

While working on the design of a website offline, everything seemed to be running smoothly. However, upon uploading it to the server, various issues began to arise. Initially, the file loaded correctly upon first visit. Unfortunately, after reloading the ...

Two divs featuring a cohesive gradient background, with one div containing a sticky element

I am currently facing a dilemma that is causing me some frustration. The situation is as follows: I have two divs on my webpage. The top div consists of a banner with the logo, while the bottom div is the navbar containing icons as links and a dropdown me ...

Is there a way to position the primefaces DefaultMenuModel in front of an accordion panel?

Currently, I have a DefaultMenuModel nested within a tab in an accordion panel. However, the menu is appearing behind the tab of the accordion panel and I want to adjust the z-index of the menu so that it appears in front of the tab. Here is the current ...

Discover the key to unlocking various types of content within individual pop-up windows

<html> <script type="text/javascript> function newWindow(url) { window.open(url, "_blank", "toolbar=no, scrollbars=no, resizable=no, top=200, left=300, width=870, height=650"); } </script> &l ...

Pausing the audio playback with a click of the mouse

As a beginner in front end development, I recently designed a simple website incorporating the Lightbox kit. One functionality I am currently working on is starting an audio track when a user clicks on a thumbnail image. However, I am seeking guidance on h ...

Issues with CodeIgniter paths causing disruption to CSS background-image declaration

I've been working on a website with backend for two separate customers, each with their own unique URLs. I encountered an issue with Javascript links (ajax calls using url:) but managed to resolve it by using a global variable: var SiteURL='< ...

What is the best way to eliminate the excess space below the footer on a vuejs page?

I am developing a footer using vuejs along with buefy. In my implementation of App.vue below, I am encountering a white margin under the footer. // App.vue <template> <div id="app"> <main-header /> <router-view/ ...

Carousel with Bootstrap: Heading positioned over the content

My goal is to have the caption of Bootstrap Carousel displayed above the content, but I'm encountering issues with it. When clicking on the chevrons, you may notice the < Item 1 > bouncing... (This behavior is a bug, and logically speaking, I ex ...

Move the modal dialog so it appears closer to the top of the page

I am facing a challenge with my jQuery modal dialog. While it is loading properly, I am restricted to using an older version of jQuery (1.12.4) and cannot upgrade it. My goal is to center the modal close to the top of the page, similar to how it is positio ...

The integration of jquery datepicker with MVC in Visual Studio 2013 allows for seamless

I recently started developing an application in Visual Studio 2013 using MVC. I am currently working on implementing a jquery datepicker to show up whenever there is a DateTime field involved. My controllers are being created through scaffolding templates. ...

Display or conceal a div based on the input value

Displaying div#cool should be triggered when the user enters the term "cool" into the input field. Similarly, showing div#good should be activated when the user types "good", and this functionality should operate seamlessly in real-time. ...

Dynamic search form technology

My HTML view includes a search form and AJAX code to handle the form request $(document).ready(function() { console.log('Ready'); $('.search-wrapper').on('click', '#find-dates', function(a) { a. ...

Implement ReactJs to generate a series of div elements

In my React component, I am working with a JSON array and generating divs to display key-value pairs. Each object in the JSON contains approximately 60 key-value pairs. In this particular case, I am rendering divs for the 19th index of each object: import ...

Having trouble with ion-item click not functioning in Ionic 3?

Working on my Ionic 3 project, I have encountered an issue with the ion-item click listener. The scenario is that I am adding text over a canvas and then attempting to change the style of the text (such as font-family, font-size, bold, and italic). The UI ...

JavaScript is restricted from being accessed beyond the confines of the ui-view element

After coming across a problem similar to one previously dismissed on stack overflow, I decided to tackle it head-on. You can find the issue and attempted solutions at this link: Previous Problem and Solutions The full project solution is available on Gith ...