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

Catalyst UI Dropdown slow with many items #1667

Open
tomh4 opened this issue Feb 5, 2025 · 2 comments
Open

Catalyst UI Dropdown slow with many items #1667

tomh4 opened this issue Feb 5, 2025 · 2 comments
Assignees

Comments

@tomh4
Copy link

tomh4 commented Feb 5, 2025

What component (if applicable)

Describe the bug
When adding many items (700+) to the dropdown menu, it gets very slow and takes a couple of seconds to open.
Maybe we could make use of a virtualized list or something?

To Reproduce
Steps to reproduce the behavior:

const numberArray = Array.from({ length: 700 }, (_, i) => (i + 1).toString());

<Dropdown>
      <DropdownButton plain>
          <p>Test</p>
        </DropdownButton>
      </div>
      <DropdownMenu>
          {numberArray.map((item) => (
            <DropdownItem key={item}>{item}</DropdownItem>
          ))}
      </DropdownMenu>
    </Dropdown>

Expected behavior
Quick opening of menu, virtualizing the list

Browser/Device (if applicable)

  • OS: macOS
  • Browser: Chrome

Additional context
It is not uncommon to have these large dropdowns, e.g. our use case is a lanuage picker which has over 700 options to choose from

@reinink reinink self-assigned this Feb 5, 2025
@reinink
Copy link
Member

reinink commented Feb 10, 2025

Hey! Thanks for reporting this. The actual issue isn't in Catalyst, but rather the underlying Headless UI library that we use to power these components. We've been able to reproduce this issue with both the dropdown and listbox components, and the team has already spent some time trying to figure out what's going on here, but unfortunately haven't cracked it yet. Mostly just providing an update here so you know that we're on it. I'll report back once we've learned more 👍

@tomh4
Copy link
Author

tomh4 commented Feb 10, 2025

Ah great to hear!
Thanks for keeping me updated and the great work!

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

No branches or pull requests

2 participants