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.
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
@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) .
Hi Luiz,
You can check the implementation in this forge component. It is Reactive, but Mobile works similarly.
Hi @Luiz Lima ,
Please check the link.
Thanks
Ridhima