react-infinite-scroller icon indicating copy to clipboard operation
react-infinite-scroller copied to clipboard

isReverse broken with combination of column-reverse

Open MariuzM opened this issue 2 years ago • 4 comments

Anyone have a good working example for chat window, that when opened start at bottom but does not start the loadMore function. Also data need to be reversed and displayed.

I've used this react-infinite-scroll-component before and with that it worked but had other issues so moved to this one.

import InfiniteScroll from 'react-infinite-scroller';

const items = ['Latest', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1', 'Oldest'];

export const Scroll = () => {
  return (
    <div
      style={{
        display: 'flex',
        flexDirection: 'column',
        height: 400,
        overflow: 'auto',
      }}
    >
      <InfiniteScroll
        pageStart={0}
        loadMore={() => console.log('load more')}
        hasMore={true}
        loader={
          <div className="loader" key={0}>
            Loading ...
          </div>
        }
        useWindow={false}
        isReverse
      >
        <div
          style={{
            display: 'flex',
            flexDirection: 'column-reverse',
          }}
        >
          {items.map((item) => (
            <div
              key={item}
              style={{
                height: 100,
                backgroundColor: '#ab7c7c',
                color: '#000000',
                fontSize: 20,
              }}
            >
              {item}
            </div>
          ))}
        </div>
      </InfiniteScroll>
    </div>
  );
};

MariuzM avatar Jan 18 '23 19:01 MariuzM

Did you manage to find a fix for this?

rafatrace avatar Jun 16 '23 13:06 rafatrace

+1

mweel1 avatar Jul 11 '23 14:07 mweel1

+1

jaffyyyy avatar Aug 31 '23 02:08 jaffyyyy

Try to add initialLoad prop as false

SukhorukovS avatar Sep 06 '23 10:09 SukhorukovS