react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

inverse didn't work

Open Nikneoberg opened this issue 3 years ago • 13 comments

I've tried using inverse infinite scrolling, but it doesn't work. I checked an example from the documentation https://codesandbox.io/s/boring-haze-4c49t?file=/src/index.js:922-935

Nikneoberg avatar Jul 06 '21 07:07 Nikneoberg

try with the latest version bro

zeroonedev01 avatar Jul 11 '21 04:07 zeroonedev01

bumping the version in the sandbox does not work

ghost avatar Jul 21 '21 14:07 ghost

Although the loading message is only being loaded at the bottom, so you do have to include style={{ display: 'flex', flexDirection: 'column-reverse' }} //To put endMessage and loader to the top.

ghost avatar Jul 21 '21 15:07 ghost

I finally got it to work. THe parent scrollableTarget that it is listening to needs to be included and have the same inverse styles. Took a lot of refreshes to get to work tho

ghost avatar Jul 21 '21 16:07 ghost

@ryan-Church, thank you.

Nikneoberg avatar Jul 21 '21 17:07 Nikneoberg

@ryan-Church can you explain your solution or give an example? I'm struggling to get it working

baj84 avatar Sep 03 '21 20:09 baj84

 <ChatWrapper id={CHAT_AREA} >
          <InfiniteScroll
            dataLength={chats.length}
            next={() => {  getMoreMessages()   }}
            hasMore={true}
            inverse={true}
            scrollableTarget={CHAT_AREA}
            style={{ display: "flex", flexDirection: "column-reverse" }}
          >
              {chats.map((chat) => {
                  return (<FormatChat/> );
                })}
          </InfiniteScroll>
      </ChatWrapper >
   

const ChatWrapper = styled.div`
  display: flex;
  flex-direction: column-reverse;
  overflow: auto;
`;
   

ghost avatar Sep 06 '21 13:09 ghost

I still cant get this to work.

https://codesandbox.io/s/silly-glitter-iszzh?file=/src/index.js

anyone see whats wrong with the above?

stevesizer avatar Sep 08 '21 21:09 stevesizer

Change version from 4.1.0 to 5.1.0 or later.

edutilos6666 avatar Sep 25 '21 10:09 edutilos6666

@same issue

choijiho0021 avatar Nov 30 '21 05:11 choijiho0021

working example : inverse infinite scroll here https://codesandbox.io/s/youthful-kapitsa-nlv1j

duke7able avatar Dec 10 '21 09:12 duke7able

@duke7able hi this work fine, but any suggest for pullDownToRefresh props if i inverse it?

nalendro16 avatar Sep 13 '22 07:09 nalendro16