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

Scroll to specific message/position

Open DmitriyNikolenko opened this issue 2 years ago • 2 comments

Motivation There are a couple of cases:

  1. A user leaves the page for some settings page, returns back and wants to stay on the same scroll position (preserve scroll)
  2. Some message in the chat is shared with a user and he wants to open it. The channel should be loaded and scrolled to the target message.

Proposed solution Provide the ability to scroll to a specific message OR scroll position.

Acceptance Criteria A user is able to open a list of channel messages in the same position when he stopped watching. A user is able to be scrolled to a specific message when he opens a channel.

DmitriyNikolenko avatar Aug 18 '23 09:08 DmitriyNikolenko

@DmitriyNikolenko Thank you for raising this request. We register it in our backlog for now.

MartinCupela avatar Aug 18 '23 11:08 MartinCupela

@MartinCupela We're happy to make a PR to support this feature if you could point us in the right direction.

therajumandapati avatar Feb 27 '24 15:02 therajumandapati

This can be solved with jumpToMessage, jumpToLatestMessage, jumpToFirstUnreadMessage. These function are exposed via ChannelActionContext. The reference to message id can be take from the URL or localStorage or sessionStorage, etc.

MartinCupela avatar May 28 '24 08:05 MartinCupela