Forum Academy Marketplace Showcase Pricing Features

Html stretch to fit content

Im building a tshirt sales app for a friend and im using the javascript snippet for SpreadShirt.
The shirt store works just fine using the html element except that when enough shirts fill the store the element just gets
cut off even though i have the stretch to fit content box checked. I have tried it alone and also in a group and still it wont stretch. anybody know how i can get it to stretch when new items are added to the shop? thanks!

1 Like

Can you share a link?

@emmanuel sure thing. I created a page in the test forum

that link doesnt seem to be working but its the app called html stretch

@emmanuel were you able to look at this and see if I was doing something wrong here?

The issue here is that the size of the elements inside the HTML element changes after the initialization, so our can’t adjust the height. Not sure we can find a good workaround there, can you preset the size in the embedded code (or make the HTML element bigger).

Hey I figured out a way.

Create a group with type of content set to text… Put a html element in the group and set the html content to parents group’s text. Go to workflows and Do when condition is true( whenever this group is visible perhaps)… Add a pose maybe 1000 ms which 1 second then display data in this group(the data being the html content you want in the group.) Make this happen every time. If you have checked stretched to fit content, this will make it stretch every time because the initialisation will happen after the given pose…

I had the same issue and putting a 1000 ms pause before making html element visible worked perfect. I think the api content was not loading fast enough so it didn’t know to stretch content.