Custom widgets; height expansion based on content

Hi,

I’m working with a custom widget that renders a table based on an object set. The number of rows (objects) can vary, so I’d like the Workshop section containing the widget to expand automatically with the widget’s height.

At the moment, the section row height is set to Auto (max), but the section does not expand when the widget content grows. Inside the widget, I can see the content height increasing (e.g. when adding a border), but the widget container and parent section remains fixed.

Things I’ve tried so far:

  • Setting the height at the top level of the widget using the CSS height property

  • Avoiding fixed pixel heights (no height: Npx)

  • Relying on content-driven sizing

Despite this, the section does not resize to fit the widget’s content.

My questions are:

  • Is there a CSS property or layout approach that can force the section to expand based on the widget’s rendered height?

  • Is this a known limitation related to how custom widgets / iframes are handled in Workshop which means this is not possible?

Thanks

Hi!

In Custom Widgets there is no way to send a desired height to Workshop. If you want to continue to use the Custom Widgets I would recommend making your custom content height: 100% and building the widget to make it scrolling friendly.

In OSDK using the Workshop Iframe Custom Widget package you can send the height of your custom content back to Workshop, where Workshop automatically resizes the component to the height you sent. Here is the documentation for that: https://github.com/palantir/workshop-iframe-custom-widget?tab=readme-ov-file#dynamic-height-control.

The goal is to eventually enable the same auto-sizing functionality we have in Workshop Iframe Custom Widget in Custom Widgets.

I hope this helps!

Thanks

Thanks, the ODSK applications are switched off for me. I will make what I currently have work for now in Workshop.

It would be good if this could be made possible from custom widgets.

I did some more research. It looks like the auto resizing is already implemented into Custom Widgets. If you have your widget set on Auto (max) the widget will be sized to the height of your content, but stop at the max height you provided. If you make it larger than you imagine your content needing to be the Custom Widget will continue to grow as your content grows.

At some level in your Workshop you will have to check the Enable Scrolling toggle. This option is at the bottom of Sections. Without this checked the Custom Widget can only expand to the max height of the flex sections, but with this toggled on the Custom Widget will grow to its correct height/max height.

I hope this solves the height issue for you.

Thanks

1 Like