chatscope / chat-ui-kit-react

Build your own chat UI with React components in few minutes. Chat UI Kit from chatscope is an open source UI toolkit for developing web chat applications.
https://chatscope.io
MIT License
1.34k stars 116 forks source link

Make onYReachStart margin based #111

Open KDederichs opened 1 year ago

KDederichs commented 1 year ago

Hey,

as described here https://github.com/chatscope/chat-ui-kit-react/issues/78 you'll run into issues with infinite scroll cause once you're at the top the scroll bar will just stay there and cause infinite history loading till there's no more.

I'd propose an optional prop where you can pass a value (hard value or percent) to the MessageList and after the user passes that point the callback function gets called.

That way you can start loading new messages while the user is still scrolling, avoiding being stuck at the top.