Dropdown button clipped in small containers?

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?

Screenshot 2023-10-30 at 3.08.49 PM

Long standing issue I'm afraid :frowning: 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 :pensive: I bumped this in our queue, so we'll see if we can push a fix soon!

@mkh - good news! We pushed a fix for this :slight_smile: Are you still seeing any clipping?

2 Likes

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...

image
image

@mkh - asking now!

@dcartlidge Helpful - thank you. Passed that along

2 Likes

Good news bad news—seems like the aligning causing clipping is actually a different bug :sweat_smile:

I filed it and linked it to this thread internally.

2 Likes

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?

image

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)
image

Regards,

1 Like

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


2 Likes

Thanks @mckenna that's exactly the solution!

That property has been around since Dec 2022 but I guess I haven't needed it before.

1 Like