# Implementing Auto Scroll for Flex Repeater

**URL:** <https://forum.inductiveautomation.com/t/implementing-auto-scroll-for-flex-repeater/73572>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [May 11, 2023, 2:29am UTC](https://forum.inductiveautomation.com/t/implementing-auto-scroll-for-flex-repeater/73572 "2023-05-11T02:29:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Ibrahim\_Shawkey](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Ibrahim\_Shawkey](https://forum.inductiveautomation.com/u/Ibrahim_Shawkey)\
**Post date:** [May 25, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/implementing-auto-scroll-for-flex-repeater/73572/5 "2024-05-25T10:09:24Z")

</div>

I have faced the same problem while building a chatting app. Here is how I fixed it:  
-for my flex-repeater that shows the messages based on their timestamps, I used a column flex repeater with direction prop set to "column-reverse" and justify: "flex-start". Then I queried my chat messages using "ORDER BY timestamp desc" and that always automatically scrolled to the latest message between the users. I found that answer on stackoverflow:

When an overflow occur to the left (or top), a scroll doesn't get rendered, and the reason is that a HTML document's normal flow is left-to-right (top-to-bottom).

Flexbox has a _row-reverse_ direction, which will solve that, thought 2 things comes with that:

- One need to reorder the items or use an inner wrapper
- I.a. Firefox and Edge doesn't show the scroll (possible bug)  
[link to stack overflow auto scroll](https://stackoverflow.com/questions/47372148/overflow-auto-not-working-with-justify-content-flex-end/47377177#47377177)

here is a screenshot of my flex-repeater props:  
 ![Screenshot 2024-05-25 at 12.09.06](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/20d032281e1db8d37ac869f1e52647b4980faa61.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/implementing-auto-scroll-for-flex-repeater/73572)._
