Scroll events on iOS may not always be triggered within a div element located inside a modal

In my Vue component within the application, I have set up a hierarchy with various styles:

<template lang="pug">
    my-modal-component.modal-container
        template(v-slot:content)
            swiper.swiper(
                :options="swiperOptions"
                ref="feedback-swiper"
                @slideChangeTransitionEnd="onTransitionEnd"
                @slideNextTransitionEnd="onSlideNextTransitionEnd"
                @slidePrevTransitionEnd="onSlidePrevTransitionEnd")
                swiper-slide.page-container(ref="modal" @scroll.native="handleScroll")
                    .content-root(:class="transitioning ? 'disable-interaction' : ''")
                        div
                            .main-text Main Text
                            pill-selector
                        .additional-details-container
                            .main-text Main Text
                            textarea.additionalDetails
                            .char-count number of cur chars
                        .contact-me
                            input.input(type="checkbox" v-model="contactMe")
                            label.label(@click="toggleContactMe")pls help
                .swiper-pagination.pagination(slot="pagination")
                .swiper-button-prev.prev-slide(slot="button-prev" @click="goToPreviousSlide()")
                .swiper-button-next.next-slide(slot="button-next" @click="goToNextSlide()")
            .button-container
                my-button.main-button SUBMIT
</template>

.modal-container {
    color: color(brown);

    .button-container {
        padding-bottom: 30px;

        .main-button {
            visibility: hidden;
            width: 100%;
        }

        .hidden {
            visibility: hidden;
        }
    }

    .page-container {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;

        .content-root {
            display: flex;
            flex-direction: column;
            height: 1000px;
        }
    }
}

The function handleScroll is designed to capture the @scroll.native event consistently on all desktop operating systems and Android devices.

However, there is an issue with iOS devices where the @scroll.native event does not always fire, resulting in unreliable scrolling behavior.

I've attempted various solutions such as:

  • Restricting scroll on the component and body using different techniques
  • Removing other occurrences of -webkit-overflow-scrolling from the app
  • Implementing https://github.com/willmcpo/body-scroll-lock
  • Trying different combinations of hierarchy and css changes involving overflow-y and -webkit-overflow-scrolling

Answer №1

Interestingly, this issue was only encountered in iOS simulators and not on real iOS devices. This serves as a valuable lesson for me as it is the first time I've noticed a discrepancy in behavior between the simulator and actual devices.

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

What other aspects of mobile design could mobile-specific CSS be focused on aside from screen size?

As a newcomer to responsive web development, I have found myself puzzled by media queries. For example, how does the following code snippet target specifically iPhones with a max-device-width of 320px: @media screen and (max-device-width: 320px) {} Woul ...

What is the best way to send multiple values from the view to a method without using two-way binding?

https://i.sstatic.net/X4ivP.png When I change the dropdown value for the route type in my code, I need to pass both the gender value and the route type ID to my data retrieval method. Currently in my HTML file, I have only written a change event. I attem ...

Having trouble calculating the number of days between two dates at this moment

I'm working with a code snippet that involves comparing two dates – a specified date and the current date. However, when trying to calculate the difference in days between these dates, I keep getting either 0 or an unexpectedly large number like "31 ...

Video background is malfunctioning on Firefox and Internet Explorer

Currently, I am facing some issues with the JQuery plugin 'videoBG'. The problem is that when I view the video offline, it works perfectly in all browsers. However, once I go online, the video stops working in FireFox and IE. It seems like the sc ...

Sending a variable with a quote from a parent to a child component in JavaScript

When attempting to pass variables from a parent to a child using jQuery, I encountered some issues with text containing quotes: In the child popup, I generated an HTML element that includes a JavaScript method call to the parent. One of the variables (lab ...

Loading a previously saved Sortable in Angular UI

I have a tabset that can be sorted, and it works as expected. However, I would like the user's tab order to be saved and not lost when they refresh the page. <uib-tabset ui-sortable="sortableOptions" class="tab-container" my-restrict access="st ...

What is the best way to transfer data from MongoDB (utilizing the Mongous module) to a Node.js view (using the Jade templating

Hello everyone, I have a quick question regarding passing data from a model (database) into a view. I am using Express, Mongous (not Mongoose) to access MongoDB, and Jade for my views. Despite trying to use Mongoose, I have not been successful in achieving ...

`Center the image on top of the text`

Currently, I am working with Bootstrap 4 to create a component that includes two tiles. Each tile has an icon image on the left side and a hyperlink on the right side. On desktop view, the tiles should be displayed horizontally and vertically centered. How ...

How is it possible that React code runs smoothly without encountering any errors?

I have a question. Recently, I started following a React tutorial on this page. Following the tutorial, I used 'create-react-app' to create my React project and deleted some unnecessary files like /src/App.js. After that, I wrote the code below ...

Styling Based on Conditions in Angular

Exploring the unique function of conditional formatting in Microsoft Excel, where color bars are utilized to represent percentages in comparison to the highest value. https://i.sstatic.net/nTGCJ.png Is there a way to replicate this functionality using HT ...

Three.js Morph Targets: A Deep Dive

I'm diving into the world of morph targets and three.js, but I'm struggling to find comprehensive documentation on this topic. Upon reviewing the source code, it seems like morphTargetInfluences[] is the key element. Can someone explain how thi ...

How can I animate a vertical line while scrolling down the page?

I'm attempting to create a dynamic vertical line that adjusts based on the position of elements on the webpage. Check out this example of what I'm aiming for: https://i.sstatic.net/JpK3FQI2.gif My attempt at achieving this looks something like: ...

Dynamic rows in an Angular 2 Material data table

I'm currently working on dynamically adding rows to an Angular 2 Data Table ( https://material.angular.io/components/table/overview) by utilizing a service called "ListService". This service provides me with the columns ("meta.attributes") to be displ ...

How can I use a jQuery selector to target all class names that start with a specific prefix, even if multiple classes are

I'm exploring a unique selection statement that will identify specific css classes in a single class attribute by using a string prefix. For instance, I am looking to target any class names prefixed with detail- from the set of sample links below. ...

Update the content of the widget

Currently, I am utilizing the following script to display NBA standings: <script type="text/javascript" src="https://widgets.sports-reference.com/wg.fcgi?script=bbr_standings&amp;params=bbr_standings_conf:E,bbr_standings_css:1&amp"></sc ...

Resize a division to fill the window while maintaining original proportions

Is there a way to resize a div so that it fills the entire browser viewport while maintaining its aspect ratio? How can I achieve this using CSS, JQuery, or both? ...

Include the providers after declaring the AppModule

When it comes to Angular 2+, providers are typically registered in the following manner: // Using the @NgModule decorator and its metadata @NgModule({ declarations: [...], imports: [...], providers: [<PROVIDERS GO HERE>], bootstrap: [...] }) ...

Issue with Full-Calendar Vue refetching events; no visible changes occur

Attempting to refresh the calendar, but no changes seem to take effect. updatePlan () { //let calendarApi = this.$refs.fullCalendar.getApi() this.$refs.fullCalendar.$emit('refetch-events');//no visible changes are occurring } ...

Assistance needed in creating a custom gallery slider using CSS

Imagine having five divs, each with float:left property, enclosed within a parent div with display:inline-block and width:auto. This arrangement results in a single row containing the 5 divs, with the width of the row being equal to the sum of the child di ...

Chrome Uploadify I/O Error

I am currently working on setting up a basic example using Uploadify, and everything is functioning correctly in all browsers except for Chrome. The main goal is to allow users to select an image to be embedded within the page. Once a file is chosen, it i ...