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

Reload/refresh with large number of Select2 widget options hangs browser #623

Open
dwasyl opened this issue May 2, 2020 · 4 comments
Open

Comments

@dwasyl
Copy link

dwasyl commented May 2, 2020

Hi there,

I'm running the latest beta build of yadcf and have run into a problem on filter reloads while in server side mode. I have one select2 multi_select widget that loads quite a few options (~1,500 or so). On the initial page load everything loads quickly without any problem, however whenever I do anything that involves a page or filter reload, it hangs the browser for ~15 seconds.

I narrowed it down by emptying out that one filter and it completely takes away the issue. I had thought moving select2 to Ajax loading of options might help, but since there is no delay on the initial page load, there might be something about the way the filter redraws the filters.

Any thoughts on how to deal with this?

@vedmack
Copy link
Owner

vedmack commented May 2, 2020

Well in case you have such a big select I would suggest thinking about make it more efficient, lazy loading upon user taps several letters or something, loading HTML select with 1.5K of options doesn't sound like a solution in any scenario.

@dwasyl
Copy link
Author

dwasyl commented May 2, 2020

The list is based on a growing list of options, is there an easy way to enable the select2 module to use ajax loading for the list? That would avoid any slowness.

But, it's also strange that the delay only happens when doing a filter change and not on the initial load.

@YugoCode
Copy link

YugoCode commented Jan 8, 2021

@dwasyl Did you solve your problem? I have a similar problem, I have a lot of options in the select2 filter, which makes using the filter really laggy.

@vedmack Any idea on how we could solve this problem? How could be implement AJAX loading or is there another solution for working with a lot of options in a select2 (multi_select) filter?

btw. Thanks for this great plugin Daniel :)

@vedmack
Copy link
Owner

vedmack commented Jan 11, 2021

@YugoCode @dwasyl if you can provide a minimal test page on jsfiddle it might speed up the possible solution

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

3 participants