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

Dropdown options Scroll to top after selecting any option #30

Open
jj-theInvincible opened this issue Dec 3, 2020 · 4 comments
Open
Assignees

Comments

@jj-theInvincible
Copy link

I checked in the fiddle link https://jsfiddle.net/wasikuss/7ak9skbb/ as well as in my application, if you scroll down and select an option then the dropdown again scrolls to the top. In case of a long list of options, it becomes frustrating for the user to scroll back to an option to select or unselect it.

@wasikuss wasikuss self-assigned this Dec 3, 2020
@wasikuss
Copy link
Owner

wasikuss commented Dec 3, 2020

please write what version of Select2 you use

@WalissonPires
Copy link

WalissonPires commented Jul 29, 2022

I have the same problem here.

Select2 4.0.5

@serefbilge
Copy link

I have the same problem with Select2 4.0.3 I commented two lines as below; the problem solved.

 container.on('select', function () {
  if (!container.isOpen()) {
    return;
  }

  self.setClasses();
  //self.highlightFirstItem();
});

container.on('unselect', function () {
  if (!container.isOpen()) {
    return;
  }

  self.setClasses();
  //self.highlightFirstItem();
});

@wasikuss
Copy link
Owner

amd-based version seems to not have this issue.

https://jsfiddle.net/wasikuss/4gaodbcy/

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

4 participants