Issue with overflowX:visible not functioning properly in react-infinite-scroll-component

After implementing the infinite scroll using the second method, I encountered an issue where the content I was displaying had overflow on width/x. I attempted to override the infinite scroll style with overflowX:visible, but unfortunately, it did not work.

<div id="scrollable-target" className="content flex flex-col items-start justify-center h-40 mt-10 flex-grow text-left max-w-[900px] mx-auto
        overflow-y-auto overflow-x-visible" ref={diary}>
            <InfiniteScroll
                dataLength={posts.length}
                next={getMorePost}
                hasMore={hasMore}
                loader={<div className=""><Stairs /></div>}
                endMessage={<h4>Nothing more to show</h4>}
                style={{
                    overflow: undefined,
                    height: undefined,
                    '-webkit-overflow-scrolling': undefined,
                    overflowX: 'visible',
                    overflowY: 'inherit'
                }}
                scrollableTarget="scrollable-target"
            >
                {posts.map((x, i) => (
                    <div key={i} className={`transition mt-3 animate-fade-in-up duration-500 ${activeDiary === x.uuid || activeDiary === null ? '' : 'opacity-50'} ${activeDiary === x.uuid ? 'scale-110' : 'scale-100'}`}>
                        <div className="flex flex-row justify-start items-center gap-1 hover:cursor-pointer flex-wrap" onClick={(e) => toogleBody(e, x.uuid)}>
                            <h3 className="font-bold noselect text-sm sm:text-base">{x.title}</h3>
                            <div className="flex flex-row justify-start items-center gap-1 text-xs md:text-base mt-0">
                                <span className="text-gray-600">@lurifos ·</span>
                                <span>{parseDate(x.timecreated)}</span>
                                <div className="transition duration-500 text-lg" id={`arrow-${x.uuid}`}>
                                    <MdKeyboardArrowDown />
                                </div>
                            </div>


                        </div>
                        <div id={`body-${x.uuid}`} className="transition-max-height duration-500 text-gray-600 slide overflow-hidden sm:overflow-clip text-sm sm:text-base">
                            {truncate(x.body, 256)}
                            <a href={'/diary/' + x.uuid} className="text-sm ml-1  text-blue-500" target='_blank' rel="noreferrer">{x.body.length > 256 ? "Read More" : ''}
                            </a>
                        </div>
                    </div>
                ))}
            </InfiniteScroll>
        </div>

https://i.sstatic.net/sRD9H.png

Note: I set the height small because I haven't generated enough data to trigger the overflow-scroll. EDIT: Upon further investigation, it seems like the issue lies with srollable-target. I removed the overflow class and replaced it with overflow-visible, which resolved the problem temporarily. However, when adding overflow-y-auto, the issue resurfaced.

Answer №1

I encountered a similar issue before, but I found a solution by adjusting the overflowX style of an InfiniteScroll container. Here is how you can implement it:

<div id="scrollable-target" className="content flex flex-col items-start justify-center h-40 mt-10 flex-grow text-left max-w-[900px] mx-auto verflow-y-auto overflow-x-visible" ref={diary}>
   <div
       style={{
          overflowX: 'visible'
      }}   
    >
        <InfiniteScroll  
            style={{ }}
         >
            {...props}         
         </InfiniteScroll>
    </div>
</div>

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

Using jQuery and Laravel framework to handle a POST request

Could someone assist me with troubleshooting a jQuery post request issue? I suspect there may be an error with the routes or controller. Here is my JavaScript code for the post request: $.post('http://localhost:8000/ajax', { ...

Attempting to customize react-bootstrap styling within a NextJS application

I'm currently working on a project using Next.js and attempting to integrate Bootstrap as the CSS framework. After installing react-bootstrap into the project, I proceeded to create the navigation bar. My goal is to assign an '.active' class ...

The useRoutes function is returning null despite the correct pathname being provided

Check out my React code snippet! I've got the Component nestled within a micro-frontend application, which is then brought into the main app using module federation. // embedded in my microfrontend. const path = '/another-component-path'; f ...

What is the functioning process of the angular method decorator?

The tutorial on creating custom decorators in Angular introduces a throttle decorator that utilizes the lodash throttle function. The implementation of this decorator can be seen below: import t from 'lodash.throttle'; export function throttle( ...

Modify KeyboardDatePicker to display the full name of the day and month

Date Selector Hey there, I'm looking to modify the date format from Wed, Apr 7 to Wednesday, April 7. Is there a way to display the full name of the day and month instead of the short abbreviation? ...

What challenges arise when implementing Javascript Postback functions in an ASP.NET Web Application?

While overseeing an ASP.NET Web application originally built by an outsourcing firm but now managed in-house, I've come across some Javascript functions added to the Master Page to handle postback events. Here's a snippet of the code - var i ...

Conceal/Reveal the ng-grid?

I have a setup with multiple tabs, where I want to display different content. Specifically, I would like one of the tabs to show an ng-grid when clicked, while hiding the grid if any other tab is selected. I attempted using ng-show and setting boolean va ...

Generating fresh line with knockout effect

Currently in the process of developing a Single Page Application (SPA). Utilizing knockout and observable array to iterate through a json array. Encountering an issue where there are br tags present within the text, but when using data-bind="text: myVar" ...

Guidelines for triggering the update of radio buttons within a Webix datatable

Is it possible to automatically update the Webix datatable when radio buttons are selected? Here is an example of a datatable: var list = [{ id:1, user:"", mail:"", rad:'' }, { id:2, user:"", mail:"", rad:'' }, { id:3, user:" ...

Encountering an error with NodeJs, AngularJs, and Mongoose: TypeError - Object.keys invoked on a non-object leading to Function.keys (native)

Here is the code snippet related to the issue: server.js file: app.post('/user', function(req,res){ console.log(req.body); var user = mongoose.Schema('User',req.body); user.save(function(err,user){ if(err) console.l ...

Storing information in an array based on a specific flag

Currently, I am developing an Angular application where I am dealing with a specific array that contains a flag named "checked". Based on the value of this flag, I need to perform certain manipulations. Here is a snippet of my sample data: const data = [{ ...

Handling errors in XMLHttpRequest using Axios in React JS

I am currently utilizing the REACT-JS framework for my FRONT-END development: Below is the action I am calling from REDUX-REACT export function UserLogin(values) { var headers = { 'Access-Control-Allow-Origin': '*', ...

Using Ajax and jQuery to redirect a page with values in ASP.NET

I have two pages: Default.aspx and DetailView.aspx. My goal is to redirect from Default.aspx to DetailView.aspx using an AJAX call and pass a value as well. Although I have tried something, the function defined in the class is not being called. The functi ...

I am unable to locate the appropriate TypeScript type for the `displayName` attribute when it is used as a prop for the `type` component

Having trouble finding the correct type as mentioned in the title. After inspecting with DevTools, I have confirmed that every component I am programmatically looking at has Component.type.displayName. For anything that is not an ElementType, the type is a ...

JQuery is facing difficulty in animating a div following the completion of a "forwards" css animation

Check out this example: http://jsfiddle.net/nxsv5dgw/ A div appears on the stage and a CSS animation is applied to it. However, when attempting to use JQuery to animate the same properties that were animated by CSS, it seems to no longer work properly. ...

Exploring the process of gathering information using Node.js' http.request

I am currently facing a challenge where I need to call a REST API URL in one method and then use the response from that call to form a subsequent query to another URL, let's say git, to fetch some information. Despite browsing through several examples ...

Having trouble displaying Vue Toast messages?

I have been trying to incorporate a toast message into my code, but unfortunately, the message does not appear and there are no errors in the console. The code functions properly and the invitation is sent successfully. I have used similar code in other fi ...

What steps can I take to ensure that the HTML code is visible on top of the animation, rather than being hidden behind

I attempted to apply the CSS rule p{ z-index: 99 !important; } but it did not have the desired effect. My goal is to have all HTML elements appear on top of the animation. Here is the code snippet: <!DOCTYPE html> <html> <head> < ...

Enhancing Dataset Quality: Incorporating Failed Results with Apify

We have implemented the Apify Web Scraper actor to execute a URL validation task that retrieves the input URL, the title of the page, and the HTTP response status code. Our testing includes 5 URLs - 4 valid ones and 1 non-existent URL. The successful resul ...

JavaScript Functions Not Being Executed by Onclick Event in Internet Explorer 8

When a user clicks, I need two functions to run. This works in Firefox and Chrome, but not in IE8. The first function should display a modal (indicating that the form is being saved, although it's not showing up) while the second function saves the f ...