Dropdown options Scroll to top after selecting any option
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.
please write what version of Select2 you use
I have the same problem here.
Select2 4.0.5
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();
});
amd-based version seems to not have this issue.
https://jsfiddle.net/wasikuss/4gaodbcy/