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

Feature Request: Select Scroll Up/Down Buttons #424

Closed
gregmsanderson opened this issue Mar 19, 2024 · 3 comments · May be fixed by #469
Closed

Feature Request: Select Scroll Up/Down Buttons #424

gregmsanderson opened this issue Mar 19, 2024 · 3 comments · May be fixed by #469
Labels
enhancement An improvement to an existing feature/component Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.

Comments

@gregmsanderson
Copy link

Describe the bug

If a select includes many items it does not add up/down arrows, or scroll the way a native select element would (or how the original shadcn behaves, which would be a better comparison).

If you scroll down this page you can see the Scrollable part which demonstrates this:

https://ui.shadcn.com/docs/components/select

Screenshot 2024-03-19 at 15 24 59

Reproduction

https://ui.shadcn.com/docs/components/select

Logs

No response

System Info

System:
    OS: macOS 14.1.1
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 122.0.6261.129
  npmPackages:
    @sveltejs/kit: ^2.5.4 => 2.5.4 
    bits-ui: ^0.20.0 => 0.20.0 
    cmdk-sv: ^0.0.15 => 0.0.15 
    formsnap: ^0.5.1 => 0.5.1 
    mode-watcher: ^0.3.0 => 0.3.0 
    svelte: ^4.2.12 => 4.2.12 
    sveltekit-superforms: ^2.10.5 => 2.10.5 
    vaul-svelte: ^0.3.0 => 0.3.0

Severity

annoyance

@FaeWulf
Copy link

FaeWulf commented Mar 20, 2024

Set "max-height" "overflow-y-auto" into <Select.Content> will solve this problem for right now.

<Select.Root>
  <Select.Trigger class="w-[180px]">
    <Select.Value placeholder="Theme" />
  </Select.Trigger>
  <Select.Content class="max-h-[200px] overflow-y-auto">
    <Select.Item value="light">Light</Select.Item>
    <Select.Item value="dark">Dark</Select.Item>
    <Select.Item value="system">System</Select.Item>
  </Select.Content>
</Select.Root>

But yes, this isn't the default behavior. It needs a quick fix ASAP.

@gregmsanderson
Copy link
Author

@FaeWulf Ah, yes, that's a good idea.

It looks like the original React one has max-h-96 on its inner div (which is presumably the Content one). So that prevents it getting too huge.

max-h-96

@huntabyte huntabyte changed the title bug: the select component does not scroll if there are lots of items Feature Request: Select Scroll Up/Down Buttons Mar 26, 2024
@huntabyte huntabyte transferred this issue from huntabyte/shadcn-svelte Mar 26, 2024
@huntabyte huntabyte mentioned this issue Jun 9, 2024
3 tasks
@huntabyte huntabyte added enhancement An improvement to an existing feature/component Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5. labels Jul 9, 2024
@huntabyte huntabyte mentioned this issue Jul 31, 2024
70 tasks
@huntabyte
Copy link
Owner

Closing as fixed in bits-ui@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to an existing feature/component Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants