Button inside a scroll box is expanded or shrunk by its child text

Text child of a button placed in a scroll box changes the size of the button. It would be fine if the child would have constant size but with a text that would change,![alt text][1] the button would change as well. I have also tried “hit test invisible”. You can see in the images that by placing the text inside the button the button size vary.

So how would you like this to look / work. I don’t see a question here.

I would like the button to have a constant size, independent of the text length

I would like the button to have a
constant size, independent of the text

What happens to the text that does not fit? Or you’re going to handle character limit manually?

You’re not including enough details to provide you with a definitive answer that suits your needs. In most scenarios it’s enough to set the button to Fill its container and it will conform accordingly. You can add padding to the slot if you want to reserve space on the sides.

If you require something truly specific and detached from any form of automatic resizing, wrap the button with a size box and override the size. This can be useful if you’re reparenting a widget from panel to panel, drag and / or have it hang out directly in the viewport - an overkill in most cases, though.

I think what you want is to uncheck the box that says ‘size by content’ or ‘fit to size’ or ‘auto size to content’. Something like that is on the right hand details panel of the button and that is likely what you are looking for.

Size to Content is a feature of the canvas panel slot - OP wants the button to sit in another container - a Scroll Box.

This would be helpful if you placed the Scroll Box in the Canvas and wanted it to have a specific size - and then the buttons inside that would need to conform providing they’re set to Fill as I mentioned above.

Ahh got ya. Yea that’s what I thought the OP wanted.

Thank you very much for your response! The size box was what resolved my issue :slight_smile: