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

Multiselect dropdown slowness #4908

Closed
iherasymenko opened this issue May 21, 2020 · 9 comments
Closed

Multiselect dropdown slowness #4908

iherasymenko opened this issue May 21, 2020 · 9 comments
Labels
Bug Frontend hacktoberfest Hacktoberfest Friendly Issues

Comments

@iherasymenko
Copy link

iherasymenko commented May 21, 2020

Issue Summary

Multi-select parameter dropdowns are super slow when the item list consist 900 items.

Steps to Reproduce

  1. Create a multi-select parameter with either hard coded values or the query result
  2. Try to select a few items

Technical details:

  • Redash Version: 9.0.0-alpha (dev)
  • Browser/OS: latest Chrome/Firefox
  • How did you install Redash: Docker

This is what's missing to solve this issue

@susodapop
Copy link
Contributor

This is more feature request than bug. Can you open a thread on the forum instead? Any <select> component is going to struggle with that many options. It probably needs an AJAX auto-complete system to really fly.

@arikfr arikfr reopened this May 21, 2020
@arikfr
Copy link
Member

arikfr commented May 21, 2020

900 items is something that I would expect still to work. @iherasymenko can you elaborate on whether the UI itself becomes slugish or just filtering the list?

@iherasymenko
Copy link
Author

iherasymenko commented May 21, 2020

Here is the video. The issue is that after selecting an item on a huge list it takes ~ 2 seconds to see it selected. For these two seconds the UI is frozen.

redash_dropdown

@gabrieldutra
Copy link
Member

I created a query in the preview environment to track this issue. I believe what may be causing it is the code to check whether all selected options are on the list. I'll give a check on it and see if I have a quick solution to improve that 👍

@gabrieldutra
Copy link
Member

gabrieldutra commented May 22, 2020

Just checked, turns out I was wrong, that method runs faster than I thought. I had Lodash's intersection as an issue in mind, that should cause issues for really large sets, but 1000 - 10000 should still be fine. (My plan was to use an internal Set to make the assertion faster 😅 ).

The problem is with Antd and it was fixed in v4, should work fine when we make the effort to upgrade from v3 (see here).

@iherasymenko
Copy link
Author

iherasymenko commented May 22, 2020

@gabrieldutra Thank you very much for looking into this. Is updating Antd something envisioned? I'd be happy to work on this update if this kind of change is aligned with the overall product vision/plan.

@arikfr
Copy link
Member

arikfr commented May 26, 2020

Is updating Antd something envisioned?

Yes, but it's unclear how much effort it will require so currently wasn't prioritized.

@gabrieldutra
Copy link
Member

gabrieldutra commented Oct 2, 2020

Ant design was upgraded to v4 🎉

Now to solve this all we need is to remove dropdownMatchSelectWidth={false} from the Select components, downside is that this will make Options width always match the Select width, which sometimes is very small. To make it a little bit better we may want to add a min-width for the options.

Changing the prop to a number value should also work (relevant docs): dropdownMatchSelectWidth={150} (need to see the value for each context).

@gabrieldutra gabrieldutra removed their assignment Oct 6, 2020
@arikfr arikfr added the hacktoberfest Hacktoberfest Friendly Issues label Oct 6, 2020
@arikfr
Copy link
Member

arikfr commented Jun 8, 2021

@rafawendel this can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frontend hacktoberfest Hacktoberfest Friendly Issues
Projects
None yet
Development

No branches or pull requests

5 participants