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

Select2 multiple breaks infinite scroll #5701

Closed
FelipeEmerim opened this issue Nov 11, 2019 · 2 comments
Closed

Select2 multiple breaks infinite scroll #5701

FelipeEmerim opened this issue Nov 11, 2019 · 2 comments

Comments

@FelipeEmerim
Copy link

When using a multiple selection select2, if I hold ctrl and select every option without scrolling or closing the component, more results are never loaded.

From what I see there was a recent fix for a similar issue ( #3088)

According to the docs:

This fixes the issue by performing the check to see if more results
should be loaded both on scroll and also when the results are first
loaded.

I believe we should also check if more results should be loaded after selecting an option, because after a certain number of options is selected, the scroll bar disappears and we cannot load more results.

Also, #1613 seems to be very similar to this, but in his case, instead of holding ctrl while selecting he just set the closeOnSelect=false.

I was able to reproduce the issue in firefox, using select2 v4.0.12 and ubuntu 18.04

@kevin-brown
Copy link
Member

the scroll bar disappears and we cannot load more results

Something isn't right here. We don't remove options so the scrollbar shouldn't disappear after you select an option in a multiple select. I also can't reproduce this locally because of that.


Can you expand upon the issue you are facing by adding a few more pieces of information to your bug report?

  • What steps can be used to reproduce the issue?
  • What is the bug and what is the expected outcome?
  • What browser(s) and Operating System have you tested with?
  • Does the bug happen consistently across all tested browsers?
  • Can you reproduce this issue on any of the examples in the docs?
  • What version of jQuery are you using? And what version of Select2?
  • Are you using Select2 with other plugins?

The contributing guide contains a useful section with a few questions which can help us track down the bug and speed up the process of finding a fix for it. The creation of an isolated test case would also be useful.

@FelipeEmerim
Copy link
Author

Hi Kevin, thanks for the support.

Something isn't right here. We don't remove options so the scrollbar shouldn't disappear after you select an option in a multiple select. I also can't reproduce this locally because of that.

After reading this I started digging deeper into our code and realized some blessed soul made a custom css to remove selected options like this.

.select2-results__option[aria-selected=true] {
    display: none;
}

This was probably taken from this answer on stackoverflow.

So, your plugin is working flawlessly because, as you said, you do not remove options.

I am sorry for taking your time and thanks again for the support.

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

No branches or pull requests

2 participants