Did you ever find a solution?
The easiest way is to turn off the clipsContent, get the absoluteRenderBounds, and then use the resizeWithoutConstraints method and change the coordinates of the children if required.
clipsContent
absoluteRenderBounds
resizeWithoutConstraints
For anyone coming here, I’ve coded up a solution that worked pretty well for my use case. Some edge cases might not be working yet though. Resizes a parent element around all children, assuming absolute positioning of both.
Github Gist - johannesvollmer / Resize to Fit (Figma Plugin API)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.