58
Views
4
Comments
Reverse initial Chat scroll.
Question

Hey guys. 

I'm developing a mobile app that has a real-time chat function with other users. 

But recently I came across a problem that I still haven't been able to get around. 

Every time I start a chat with another user or join an existing chat. This chat starts at the top of the chat, but the order of the chat is: most recent messages at the bottom and oldest at the top (like Instagram chat for example). 

How can I make it so that every time I enter a chat the screen scrolls to start at the bottom so that it initially displays the most recent messages? 

I am very grateful to everyone who can help me. 

Thank you very much. 

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

You can use the ScrollToElement action for this. See for more details the solution of this older discussion:

https://www.outsystems.com/forums/discussion/66326/scroll-to-a-element-in-a-list/

Regards,

Daniel

2023-10-12 01-08-03
Luiz Lima

@Daniel Kuhlmann 

I think my question was not clear. 

Using scroll to element when opening the chat, it will scroll the page to the end showing the most recent message, needing to load the messages at the bottom. 

What I would like to know is if there is a way to set the chat to start at the bottom (most recent messages) and if you scroll the chat to the top then yes it would load the rest of the messages (older messages) .

2023-09-28 14-21-55
Daryna Kravets

Hi Luiz,

You can check the implementation in this forge component. It is Reactive, but Mobile works similarly. 

2022-07-14 13-58-54
Ridhima Shewani

Hi @Luiz Lima ,


Please check the link.

Thanks

Ridhima

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.