stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

bug: Chat Component Re-renders and Causes Layout Shifts on Small Screens

Open lildinozzz opened this issue 1 year ago • 4 comments

When opening the chat on smartphones, after the component is mounted, a re-render occurs, causing the message list to jump to the middle of the conversation. This results in an unpleasant lag or jump, affecting the user experience.

To Reproduce

Steps to reproduce the behavior:

  1. Open the chat on a smartphone.
  2. Wait for the component to mount.
  3. Ensure there are many messages in the conversation.
  4. Observe the message list jumping to the middle of the conversation after re-rendering.
  5. Feel the slight lag or visual jump.

Expected behavior The message list should remain at the last message without shifting or jumping after the component is mounted and re-rendered.

Component Mounts: Image

After 1 second: Image

Package version "stream-chat": "^8.47.1", "stream-chat-react": "^12.8.1",

Smartphone (please complete the following information): Device: iPhone 15 Pro OS: iOS (latest version) Browser: Chrome, Safari (latest versions)

The issue occurs specifically on smartphones, with recent versions of Chrome and Safari browsers. After the chat component mounts, the message list jumps to the middle of the conversation, creating an unpleasant feeling of lag or stuttering.

lildinozzz avatar Jan 17 '25 15:01 lildinozzz

Hey, @lildinozzz, could you please specify which message list component you're using? Our SDK allows our integrators to choose between VirtualizedMessageList and MessageList.

arnautov-anton avatar Jan 17 '25 16:01 arnautov-anton

Hey, @lildinozzz, could you please specify which message list component you're using? Our SDK allows our integrators to choose between VirtualizedMessageList and MessageList.

MessageList

lildinozzz avatar Jan 19 '25 18:01 lildinozzz

Hey @lildinozzz , I tried to reproduce the issue with iPhone 15 Pro with app in examples/vite and was unsuccessful. Are there any customizations you have done to the application?

Could you please try to recreate any relevant customizations in a forked sandbox?

MartinCupela avatar Jan 30 '25 09:01 MartinCupela