Custom Component resize, set heightType to auto?

I am building a custom component that displays a picture from a URL or byte string. Then the user can click on the picture and a red dot will appear and the coordinate will be reported. Then these coordinates are used for other purposes later.

Everything seems to be working just fine, however, I have an issue with the size of the component when changing the size of the browser window. When using the exiting Image component it has heightType: "auto" but custom component has heightType: "fixed" and therefore the custom component is incorrectly being resized - I want it to be resized exactly as the existing Image component.

Can someone help me to achieve this?

Here's the Model:

{
"imageUrl": {{image_url_text.value}},
"clickCoordinates": [],
"imageWidth": 0,
"imageHeight": 0
}

Here's the IFrame Code:

body { display: flex; justify-content: center; align-items: center; height: 100%; margin: 0; } #image-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: auto; } .img-wrapper { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; } img { width: 100%; height: 100%; object-fit: contain; }

Hi @Nauris_Dorbe! Welcome to the community!

We have a feature in beta for making the height of a custom component dynamic based on its content. Does that sound like what you're looking for? It's not available by default, but I added it to your account if you want to try it out.

Let me know if it helps! :crossed_fingers:

2 Likes

Awesome, thank you very much. This indeed seems to solve the problem I was facing! :slight_smile:

Hello, I would like this feature too please too for my account! I have a custom component that renders multiple rows of data, and I need a dynamic height so the user doesn't have to scroll.

Hi @Ash_Khan I added this to your account. Let me know if you have any questions or concerns !

Thanks a lot for the quick reply! Working great now, thanks.

Is this feature still in beta? If so could I have it added as well?

Yes, it's still in beta. I've added it to your Cloud account :blush:

Is this feature sill in beta? it would be extremely usful.

Hi @DavidSmith,

It is, but our team is just starting a larger custom component project, so I hope this can be moved forward :blush: I've added it to your Cloud account for now.

Me too! So useful to have this! Now my students have to scroll.

add me . thanks

Hi @Mark_Png I added this for you!

@AnsonHwang I wanted to double check what org to add this to? Is it the organization linked to the email you have here on our forum? We add features based on the subdomain for Cloud or license key for on-prem (feel free to dm if you don't want to post it here)

Hi @Tess,

I'm very interested for this feature too, could you add it to my account?

Thanks a lot for your help.

Best regards,
Aurélien

Hi @gustus added! :blush:

Hi @Tess,

Could you please add this to my account

thx
John

Added, @johnzh!

Hi @Tess
Can you add this function to my account too?

@Tess Can I get this feature enabled too, please?

Added for you both!

1 Like