How to Dynamically Resize a section

How can you dynamically resize a section?

Wix Studio or Velo.

I have a repeater inside a section, I have implemented a search functionality where I change the data for the repeater based on the search input, everything works fine with that part. But the section that contains the repeater keeps the same size, so when I return 2 objects from the repeater I’m left with a big gap at the bottom of the page.

I tried setting the height to auto but that keeps it at the same size it doesn’t look at the size of the repeater.

1 Like

Someone else asked the same question…

1 Like

The solution doesn’t apply to WixStudio, just Wix Editor. Any advice?

1 Like

You’ll likely need to enable advanced sizing on the section and set it’s height to max-content so that regardless of the content within, it’ll always “hug the height” of it’s content

Hey! Have you found a solution for this?

1 Like

This does not seem to do anything for me.

_

EDIT: In case anyone comes across any issues suddenly with sections not resizing to hug dynamic content properly, and you already have the content linked up - try disconnecting the repeater from the dataset, then resizing the section to the repeater, then reconnecting the repeater to the dataset. My plight with this issue seems to have been solved by doing this and has caused minimal impact to elements within and around it.

FAO Wix: We shouldn’t have to do this.

1 Like

Scratch that, it fixed it for a grand total of 18 hours, and it is now gone back to having a massive blank space. It no longer is preventing this from happening.

This [Wix Studio] is far too inconsistent for a “professional product”.

2 Likes

Can you please explain in more detail how you set the height of a section to be “max-content” using the advanced sizing options? There is no such clear option for this, and I have so far had to mess around with the same section + repeater 5 times now, and the page keeps readjusting and leaving me with a huge blank space.

1 Like

It’s difficult to say exactly what you’re experiencing - screenshots/link to the site it’s happening on are a huge help :slight_smile:

It could be additional margins that are set on child elements that leave the gap, or something like a min-height set on the section. If it’s one of those, we have a troubleshooting video for it here - https://www.wix.com/studio/academy/tutorials/fix-sections-and-containers-that-wont-resize

Thankfully, I found the solution to my issue with some direction from Wix support, but I still had to figure it out through trial and error. I had to enable advanced CSS grid, then expand the “rows” and ensure it was set to min/max, then click on the values/edit pencil button next to the box that has min/max in it and set “min”=“min-content” and “max”=“max-content”.

For others’ benefit, I think you need to clarify what you mean by the “solution” here. Enabling advanced sizing for a section doesn’t provide a “max-content” option, so I wasted time searching for something that doesn’t exist; on top of the time I’ve already wasted on other potential solutions for this issue, and other issues as well.

If this option was removed, why? It’s surprising to see a post from a community manager with an outdated solution from just four months ago. Despite how minimal that change may seem, if Wix changes configuration options that quickly, community managers should be informed to avoid providing soon-to-be-invalid solutions. Otherwise, their role loses its purpose, and trust in those responses will fall.

If you think I’m not looking in the right place (such as you were actually referring to enabling advanced CSS grid), then I’d offer the critique that all solutions should include a screen snip to illustrate where it is found, eliminating any variation in nomenclature or similar configuration options. In fact, I’d say this should be the standard in general, as it would save a lot of time for people looking for solutions by clearly indicating if a solution applies to an outdated version of the platform.

I had the exact same issue as you, and I really appreciate you saving me from a major headache! The solution was indeed adjusting the min/max row height for my section/repeater.

I’ve been working in Wix Studio for about four months now, and I’ve noticed that nearly every issue related to elements or sections not being responsive—or strange white space appearing—is almost always caused by the min/max size settings in a cell, stack, or repeater. However, for new users or those who haven’t encountered these kinds of issues before (which I have a lot), realizing that min/max values need adjusting can be really hard to find as you need to enable advanced settings. If you’re working with a complex layout that includes stacks inside containers with max-content, percentages and other settings, you’ll need to check every single element to ensure that no min value is interfering with your desired responsiveness.

So I just wanted to jump in here to help more people find the solution to these kinds of problems!