ReactJS Application: Issue with Selective Mobile Scrolling

I've been working on a ReactJS web app where we mainly use styled-components for styling, but also sometimes utilize index.css for global styles (such as body and html).

The application consists of an app header, a page header, and a container with additional components.

Recently, I've encountered a strange issue where certain mobile devices, specifically the Sony Xperia XCompact and the Samsung S8, are unable to scroll down.

Here are snippets from the .js files: (The components are spread across multiple files, so I've tried to include everything that may be relevant.)

// app.js
const AppHeader = styled.div`
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  height: 100px;
`;

const PageHeaderContainer = styled.div`
  display: grid;
  grid-template-rows: auto auto;
  padding-bottom: 0px;
  padding-top: 10px;
`;

const Container = styled.div`
    max-width: 414px;
    height: 100%;
`

export default = () => ( 
<AppHeader/>
<PageHeaderContainer>
    <Greeting/>
    <PageTitle/>
</PageHeaderContainer>
<IntroductionSlider>
    <Container>
        {/*more components*/}
    </Container>
</IntroductionSlider>
)

These issues can't seem to be resolved by the index.css file:

html, body{
    overflow-x: hidden;
    border: none;
    outline: none;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    scroll-behavior: smooth !important;
    position: absolute;
    margin: 0;
    padding: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    width: 100%;
    height: 100%;
}

Although this code works perfectly in Chrome, Opera, and other mobile browsers like Pixel 2, S10, Pixel 3, and iPhone 7, the scrolling function is somehow disabled on Sony Xperia XCompact and Samsung S8+.

As a temporary solution, changing the height of body to auto instead of 100% re-enables scrolling (tested on the Sony phone). However, the root cause of this problem still eludes me.

Since much of this codebase was inherited, I'm still relatively new at this job and trying to grasp how things work. Any insights or assistance would be immensely appreciated!

Answer №1

There was a known issue in the previous version of Mobile Chrome which has since been rectified. Either implement the following fix or patiently await the next update.

max-width: calc(100% - 1px);

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

Personalizing CSS for a large user base

My website allows users to choose themes, customize background, text, and more. I am seeking the best method to save all of these changes. Is it preferable to use a database read or a file read for this purpose? Any recommendations are greatly appreciate ...

Creating a bootstrap form field that spans 100% in width:

I am encountering an issue with two column divs in a row, each containing two text fields. When resizing on mobile, the width of the textbox is not expanding to 100% and looks unattractive. Below is my Bootstrap code, but strangely, the width looks fine f ...

Converting Database Information to JSON Format for Mobile Authentication Form

Currently, I am working on a Mobile App project using Phonegap that requires users to log in before retrieving JSON data. This PHP page is responsible for connecting to the mobile site and fetching the necessary information. <?php $con = mysqli_connec ...

Angular form displayed on the screen

I'm having trouble finding a solution to this issue, as the form data is not being output. var app = angular.module('myApp', []); app.controller('mainController', ['$scope', function($scope) { $scope.update = funct ...

Encountering an ECONNRESET error in Next.js when making a GET request to an API within the getInitialProps function

An error has been encountered in a next.js application when sending a GET request using Axios in the getInitialProps of the _app.js file. if (typeof window === "undefined") { // user = await checkAuth(ctx); // const token = ctx.req.head ...

Customize the appearance of each element in ng-repeat individually

In my code, I have implemented an ng-repeat. Each alternate div inside the ng-repeat is supposed to have a different border-color, which is achieved by using the following structure: <div ng-repeat="channel in channelList"> <div ng-style="get ...

dealing with errors coming from a child asynchronous callback function

function main(){ try { subCallbackFunction(1,(err,res) =>{ if(err){ throw Error(err); } }) } catch (e) { /// Handling error from subCallbackFunction inside this catch block ////// conso ...

Adding default parameters in AngularJS Route-UI is a useful feature for setting up

Using angular UI-Router in my app, I've set up my base language as English. I have both English and Hebrew locals, and I want to avoid adding parameters to the URL if the language is English. For instance: Home English --> http://example.com/ Ho ...

Overlap of columns within a nested flexbox arrangement

While working with React and Styled Components, I encountered a problem of elements overlapping each other: https://i.stack.imgur.com/RuCYu.png There are a few instances of overlap, including: The padding below the <ul> element is colliding with ...

JavaScript errors due to miscalculations Incorrect calculations lead

Here is the formula I am using in my Javascript code: total = parseFloat(unit * rate) + parseFloat(rateamount) + parseFloat(((unit * rate) + (rateamount)) * (tax/100)); The values for the variables are as follows: unit = 5, ra ...

Integrate information from Laravel controller into React script

Located deep within my components tree, I have a select tag that needs to be populated with data fetched from the backend when the page initially loads. Is there a way to pass data using with in my controller and then send it to an auxiliary js file? ret ...

Unable to create canvas drawings using fingertips on mobile web browsers

Check out the code snippet below: canvas = document.getElementById("canvas"); ctx = canvas.getContext('2d'); tmp_ctx = element[0].getContext('2d'); element.bind('mousemove touchmove', function(event){ if(draw ...

Error message: WebTorrent encountered an issue and was unable to pipe to multiple destinations at once

Upon attempting to stream video from a provided torrent file, I encountered some unexpected issues. The example was taken from the official site, so one would naturally assume it should work seamlessly. To troubleshoot, I tried setting up a default site u ...

No definition found for state

Currently, I am facing an issue while trying to fetch data from an API, set it on my State, and display that state in a table. The problem arises because the render method is called first, causing my state to be undefined which leads to this specific issue ...

Having trouble displaying images in Express JS

Here are the lines of code that I wrote in Express: res.write("The current temperature is "+temp+". "); res.write("Weather is currently "+weatherDes); res.write("<img src=" +imageURL+ ">"); res.send() ...

Caution: The `className` property does not align with Material UI css which may cause issues upon reload

https://i.stack.imgur.com/MxAiY.png If you are facing the error/missing CSS, check out this video for a visual representation. While older versions of similar questions exist on Stack Overflow such as React + Material-UI - Warning: Prop className did not ...

Error: Attempting to access the 'results' property of an undefined object in ReactJS leads to a TypeError

Struggling with ReactJS as I dive into API data retrieval. Even though the data loads successfully, attempting to access "items.results" in MovieRow.js triggers the following errors: *Uncaught TypeError: Cannot read property 'results' of undefin ...

Refine objects based on their properties without removing them from the dataset

I have a specific object structured as follows: var myObj: { 2:"None", 20:"A", 31:"A", 32:"A", Social:"B", Method:"None" } My goal is to retrieve the object without the properties 'Social' and 'Method'. Initia ...

How to extract words from a dynamic router.pathname in NextJS when only the filename is displayed instead of the full path?

I'm keeping this example as straightforward as possible, but I can add more details if needed to solve the issue Currently, I am working with dynamic routes in nextJS. My application fetches data from Twitter based on the keywords entered into the dy ...

Tips for setting up a bookmark in bootstrapvue

Hello everyone, I am currently working with bootstrapvue and I need help figuring out how to add a favorite icon. The documentation only provides icons for rating systems. I have a list of reports and I want users to be able to mark their favorites, simil ...