Is there a way to prevent a Dropdown Button component from being clipped in small containers? See screenshot example. I'm trying to create a contextual menu using a ••• button, which is a pretty common UI element these days, but the dropdown menu gets clipped to the size of the container it's in, making it useless here. Is there a better way to do this? Or is this a bug with the component?
Long standing issue I'm afraid Victoria had some ingenious workaround suggestions though:
In the Appearance section, the 'Min list width' option is available, but it doesn't appear to function properly. bug ? Known issue
Definitely a bug I bumped this in our queue, so we'll see if we can push a fix soon!
Great news!! What version? We're on self-hosted so we'll need to do an upgrade here soon.
Seems to be an issue if you align the button...
Good news bad news—seems like the aligning causing clipping is actually a different bug
I filed it and linked it to this thread internally.
I still can't replicate the solution by @dcartlidge (changing the alignment of the dropdown to default). I tried all alightments.
Is there something else I can check?
Hello @stewart.anstey!
Are you looking to implement behavior on the dropdown of a visual look?
If so what are you aiming to achieve?
Hi @Jack_T,
Thanks for getting back to me.
I'm trying to get the drop down action text to widen to fit the names/text of all the actions included. But I don't want to widen the button itself as this prevents placing other UI components next to it.
I can appreciate how it is more practical for you to have the drop down action text fit the width of the visible button (in terms of html flex-box etc).
Bad: How it looks currently (one unit width and cropped text)
Better: How it looks when the button is two units wide
Best: How it should look (typical for most frameworks)
Regards,
Hi @stewart.anstey! Have you tried the "Min list width" control for this? It allows you to control the width of the dropdown menu without affecting the button width, which I think will accomplish what you're looking for
Thanks @mckenna that's exactly the solution!
That property has been around since Dec 2022 but I guess I haven't needed it before.