Fixing the mobile display issue with react-responsive-carousel

I am relatively new to ReactJS and I am looking to develop a responsive Carousel. Here is the code snippet that I have currently:

To achieve a responsive Carousel for both desktop and mobile devices, I utilized the react-responsive-carousel library.

The issue arises when switching between slides on mobile. Instead of displaying the next slide properly, it only partially shows up along with the current slide. This unexpected behavior can be better understood by viewing a brief gif I created demonstrating the problem.

In contrast, the Carousel functions correctly in desktop view. I have included another gif illustrating this.

If you could provide any insights on what might be causing this inconsistency in Carousel behavior, I would greatly appreciate it.

// Code for Carousel component...
// CSS styles for Carousel...

Thank you in advance for your assistance and advice.

Answer ā„–1

I haven't had the chance to work with react-responsive-carousel yet, but I have been using react-slick in all of my projects and it has always worked perfectly for me when it comes to responsiveness. You can find more about it here.

Answer ā„–2

Dealing with a comparable issue regarding the library, I successfully resolved the mobile problem by incorporating some additional CSS lines into the primary div of my Carousel component:

@media only screen and (max-width: 600px) {
  .carousel-wrapper{
    max-width: 100%;
  }
}

Answer ā„–3

To resolve the problem, include the parameters below:

allowMovementAfterSwipeScrollTolerance={true}
swipeScrollTolerance={50}

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

I am leveraging AngularJS to display a modal window with Bootstrap and Spring servlet integration

In my project, I am utilizing AngularJS to display multiple pages. One of these pages contains a smart-table where I showcase the details of "users". When I wish to edit one of the users, I aim to display the edit page as a popup window. Below is an excer ...

Elements not being styled by CSS properties

I am facing an issue with a CSS file designed to theme a page in white on black, as opposed to the usual black on white. body { background-color: black; } h1 h2 h3 h4 h5 h6 p { color: white; } However, the color: white; property is not being applied ...

Utilizing Google Language API for bulk translation tasks

My current project involves using Google's AJAX Language API to translate each element in an array. for(var i=0; i < mytext.length; i++) { google.language.translate(mytext[i], originalLanguage, newLanguage, function(result){ if(!result.error){ ...

Utilizing a window.onload function in Microsoft Edge

After trying to run some code post-loading and rendering on the target page, I was recommended to use the Window.load function. This method worked flawlessly in Firefox and Chrome, but unfortunately, I couldn't get it to function in IE. Is there an al ...

What causes the unexpected behavior of __filename and __dirname after being minified by webpack?

Could someone offer some insight into a strange issue I've encountered? In my project, the structure is as follows: index.js src/ static/ favicon.ico styles.css server.js routes.js app.jsx //[...] dist/ /sta ...

Tips for saving an array of objects in local storage and transferring it from one file to another

Recently delving into the world of localstorage, I've encountered an issue while attempting to store JSON data in one file and retrieve it in another. The JSON data below was fetched from a URL, and my goal is to obtain all the feed objects in the oth ...

Striving to convert Celsius to Fahrenheit using ReactJS

I am currently attempting to convert Celsius into Fahrenheit within this specific div. Despite being fairly new to React, Iā€™m finding it challenging to determine where exactly to place the conversion calculation. return ( <div className="app& ...

Utilizing React Hook Form alongside Material UI's Select Component

I've been struggling to properly integrate React Hook Form with specific Material UI components. While I've managed to make it work with simple Text Fields, I'm encountering issues when it comes to nested components. My current challenge in ...

Troubleshooting AJAX Problems in ASP.NET and C#

I am currently working on implementing a WebMethod call in my C# code behind using AJAX. I have a Bootstrap Modal that should be displayed when a linkbutton is clicked, triggering the execution of the WebMethod through AJAX to populate a table in the modal ...

Rearrange the JSON response to make it compatible with the treeData structure needed for react-simple-tree-menu

I've developed a React component that fetches an array of objects (key-value pairs) from a REST API using an HTML endpoint: [ { "id": 1, "grouping1": "first-level-node-1", "grouping2": "second-level-node-1", "theThing": "third-leve ...

Is there a substitute for AngularJS $watch in Aurelia?

I'm in the process of transitioning my existing Angular.js project to Aurelia.js. Here is an example of what I am trying to accomplish: report.js export class Report { list = []; //TODO listChanged(newList, oldList){ ...

Exploring recommendations using AngularJS

I am currently working on replicating the search suggestion feature found at: where certain words are displayed as you type in the search box. Here is my HTML setup: <form ng-controller="SearchCtrl"> <input name="q" ng-model="query" ng-keyp ...

Navigating to another page after successful login using axios in reactJS

I am currently working on developing a login page using React. Once the user submits the form, the data is sent to the server (PHP/Symfony) for processing of the login logic and returns a JSON object indicating success or error. If the user's credenti ...

extracting only the date in either dd-mm-yyyy or yyyy-mm-dd format from the MUI x Date Picker

Having an issue with React Hook Form and MUIX Date Picker where the selected date shows the value attribute as 2024-06-26T18:30:00.000Z. I have attached a screenshot for reference. Please follow this link to view the problem <Controller name="do ...

Storing an array of objects in Firestore using JavaScript presents a challenge

I am attempting to save an object to Firestore which includes an array: { returnMode: false, id: "SE-74c5219a-acfe-4185-9e33-f78b10ac3f1e", prices: [ { price: { twoHours: 0, firstHour: 0, id: "zero&quo ...

Problem with the overflow setting of a specific div

My website is currently hosted on a test server at medexcel.comeze.com. However, I am encountering an issue where the overflow of the top div is no longer hidden when I hover over a menu button in the top bar. This results in the bottom right corner of th ...

What is the best way to create a video that takes up the entire height of a half-sized

page url: I am facing a challenge with displaying a video that has dimensions of 4096x2160 pixels. I want to show the centered part of the video with full height on my left half screen. Despite trying various methods, I have not been able to find a suita ...

Tips for automatically inserting a "read more" link once text exceeds a certain character count

Currently utilizing an open-source code to fetch Google reviews, but facing an issue with long reviews. They are messing up the layout of my site. I need to limit the characters displayed for each review and provide an option for users to read the full rev ...

Personalized service implemented in Angular's .config settings

I've come across a few examples of how to insert custom providers into angular's .config, but I'm struggling to do it correctly. Here's the provider I have: (function() { var app = angular.module('application.providers', [& ...

Adjusting the display of HTML elements depending on geolocation authorization

I am currently facing an issue with my HTML code where I want to show an element only if the user declines to share their location with the browser. However, my code is not functioning as expected when the user rejects the location request. On the other ha ...