Select2 doesn't scroll down automatically on selected option on opening

Hi everyone,

When I select the option named “Item 6” (at the middle of the list) and re-open select2 element, it doesn’t scroll down automatically on the selected option on opening but stays at the top.

Here is the reconstruction of the fully working example: jsfiddle

Investigating that “.select2-results__options” css setting of “max-height: 200px” can be where problem start? Because when set this to 500px and re-open select2, it scrolls down on the selected option as expected. Please see the images below.

image

image

Re-initializing select2 after disabling options causes something wrong.

Any help will be appreciated. Thanks.

Hi finnegers,
have you tried to implement this solution?
https://stackoverflow.com/questions/33436676/how-to-scroll-to-the-selected-option-on-click-of-a-button