Skip to content

Combobox causes sluggish UI with large number of items #3575

@fiadliel

Description

@fiadliel

Current Behavior

If the combobox is initialized with a large number of items (e.g. 10000), it causes very laggy page responsiveness, due to a large number of buttons in the DOM.

Since the filtering and rendering is done in skeleton rather than Zag, this seems to be an issue to be handled in skeleton.

Expected Behavior

By default (and maybe it can be customizable), set a reasonable maximum number of nodes to be rendered. The options array can be just sliced to this length before looping through items to render the menu. I'm using 50 here, but I suspect in most cases, more than that isn't very useful.

An alternative is to have the ability to pass a custom filter, e.g. #3328 - but a fix for this issue doesn't necessarily have to go so far.

Steps To Reproduce

  1. Using the combobox from https://www.skeleton.dev/docs/integrations/popover/svelte#combobox
  2. Create a combobox with a large number of items (10000+)
  3. See that the page is laggy when rendered, until the items are filtered down to a smaller subset

Link to Reproduction / Stackblitz

https://stackblitz.com/edit/sluggish-ui-combobox

Environment Information

System:
OS: macOS 15.5
CPU: (16) arm64 Apple M4 Max
Memory: 538.75 MB / 48.00 GB
Shell: 4.0.2 - /opt/homebrew/bin/fish
Binaries:
Node: 23.10.0 - ~/.local/share/mise/installs/node/23.10.0/bin/node
npm: 10.9.2 - ~/.local/share/mise/installs/node/23.10.0/bin/npm
pnpm: 10.11.1 - ~/.local/share/mise/installs/pnpm/10.11.1/pnpm
bun: 1.2.15 - ~/.local/share/mise/installs/bun/1.2.15/bin/bun
Watchman: 2025.05.26.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 137.0.7151.69
Safari: 18.5
npmPackages:
@skeletonlabs/skeleton: ^3.1.3 => 3.1.3
@skeletonlabs/skeleton-svelte: ^1.2.2 => 1.2.3

More Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest a feature or introduce and update to the project.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions