You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
min-w-fit not working with virtualization in USelectMenu #5534
When using the USelectMenu component with the virtualize option enabled, the min-w-fit class applied via the ui.content property does not behave correctly. The dropdown content does not resize to fit the longest item.
Without virtualization, the same configuration works as expected, the dropdown expands to show the full content width.
Additional context
Expected behavior:
Unexpected behavior:
Logs
Reacted by DOMArtist, kev-7777, Filip Kotłowski, 1024mb and pbartyla-code
I think this is a limitation of how virtualization works. When virtualization is enabled, the items in the select list are absolutely positioned, which means that intrinsic layout calculations for width and height cannot impact the parent container since they're no longer part of the normal document flow.
You can work around this by either precalculating the width and applying it during onMounted or by setting an explicit width on the content.
I tried using truncate, but then the items started overlapping and it looked wrong, specifically because they are absolutely positioned due to virtualization. I also don’t want to manually calculate widths, since that would be more of a workaround than a proper solution. Does anyone have a recommended solution for handling a select with virtualization and long option names so that the list remains readable?
Unfortunately, I don't have a solution for this as items are absolutely positioned when using virtualize prop. However, it doesn't prevent you to specify the width you want: :ui="{ content: 'w-80' }".
Activity
plycos commentedon Dec 7, 2025
I think this is a limitation of how virtualization works. When virtualization is enabled, the items in the select list are absolutely positioned, which means that intrinsic layout calculations for width and height cannot impact the parent container since they're no longer part of the normal document flow.
You can work around this by either precalculating the width and applying it during
onMountedor by setting an explicit width on the content.fkwww27 commentedon Dec 8, 2025
I tried using truncate, but then the items started overlapping and it looked wrong, specifically because they are absolutely positioned due to virtualization. I also don’t want to manually calculate widths, since that would be more of a workaround than a proper solution. Does anyone have a recommended solution for handling a select with virtualization and long option names so that the list remains readable?
fkwww27 commentedon Jan 8, 2026
Any updates on this issue? Just following up after a month of inactivity. @benjamincanac
pbartyla-code commentedon Mar 6, 2026
The problem is still present in version 4.5.1. Is there any update on when this might be fixed?
benjamincanac commentedon Mar 10, 2026
Unfortunately, I don't have a solution for this as items are absolutely positioned when using
virtualizeprop. However, it doesn't prevent you to specify the width you want::ui="{ content: 'w-80' }".