# Allowing a Flex Repeater to grow based on number of instances

**URL:** <https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524>\
**Category:** Ignition\
**Created:** [May 7, 2020, 2:37pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524 "2020-05-07T14:37:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgestephens](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@georgestephens](https://forum.inductiveautomation.com/u/georgestephens)\
**Post date:** [May 7, 2020, 2:37pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/1 "2020-05-07T14:37:25Z")

</div>

Hi all,

I have a flex repeater in a flex container that I would like to grow to avoid the number of instances causing scroll bars on the side. Hopefully the below image will help explain what I mean if that doesn’t make sense!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a782ded205590ec2c085223b33ace91a9b74db0c.png)

I basically want to avoid the scroll bars highlighted in red by allowing the flex repeater to expand to roughly where the blue line is.

Is there a simple way to do this rather than have to use a script to calculate the repeaters height as I want to try to avoid issues with users resizing the page?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 7, 2020, 2:44pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/2 "2020-05-07T14:44:07Z")

</div>

Try setting `position.basis` of the repeater itself to `100%`, instead of a fixed pixel value.

---

<div class="post-metadata">

**Author:** ![georgestephens](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@georgestephens](https://forum.inductiveautomation.com/u/georgestephens)\
**Post date:** [May 7, 2020, 2:50pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/3 "2020-05-07T14:50:33Z")

</div>

Wow thanks for the quick response!

Well it kind of works but it doesn’t seem to stop where I would expect it to (after the bottom of the last instance)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5fd335d9eb1767cd39a6505be83f659622985446.png)

Instead it takes up what I would asume is 100% of the default height of the parent object in this case 800.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 7, 2020, 2:54pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/4 "2020-05-07T14:54:59Z")

</div>

Ah, not a web developer by any means. Maybe `auto` or `content` or `max-content`? [https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis)

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [May 7, 2020, 2:59pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/5 "2020-05-07T14:59:34Z")

</div>

I use `auto` on the basis for anything that needs to fill only the space required  
`grow: 0`  
`shrink: 0`  
`basis: auto`

and if that doesn’t quite look right set `grow` and `shrink` to 1.

---

<div class="post-metadata">

**Author:** ![georgestephens](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@georgestephens](https://forum.inductiveautomation.com/u/georgestephens)\
**Post date:** [May 7, 2020, 3:06pm UTC](https://forum.inductiveautomation.com/t/allowing-a-flex-repeater-to-grow-based-on-number-of-instances/34524/6 "2020-05-07T15:06:09Z")

</div>

basis = auto was the trick!

Thank you all!
