Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combobox and Select component overflows if options list is too long #2034

Closed
mustafahasankhan opened this issue Dec 2, 2023 · 4 comments
Closed
Labels

Comments

@mustafahasankhan
Copy link

Description

When using Combobox or a Select component, if the list of options is too long then they overflow.

Expected behaviour

Ideally both component should have a scroll bar if list length is greater than an ideal number either dynamically calculated from view port or like a constant say 5.

Screenshots

image

@tvankith
Copy link

tvankith commented Dec 3, 2023

@mustafahasankhan the component created by cli has a preset maximum height. Perhaps setting a maximum height for SelectContent could resolve this problem

eg: <SelectPrimitive.Content className={cn( "max-h-96...

@servesh-chaturvedi
Copy link

servesh-chaturvedi commented Dec 3, 2023

I set this up using cli. Checkout the select component itself and copy paste the code. You can change the height by changing the max-h-96 class of SelectPrimitive.Content.

@shadcn
Copy link
Collaborator

shadcn commented Feb 11, 2024

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

@shadcn shadcn closed this as completed Feb 11, 2024
@swingthrough
Copy link

This is still relevant.

However there is also this problem:
radix-ui/primitives#1159
When combobox is used inside of a modal, and it overflows, it cannot be scrolled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants