Luke Johnson
Author:
Luke Johnson
Date:
October 10, 2019
Ask a question
Email Luke
A fix for the jump-to-top behaviour when clicking on a Select2 select box.

Select2 is a popular plugin to enhance field

This solution was provided by Andrei Victor.

Include this javascript function in your page directly after the "select2.js" file. Then, set the dropdownPosition option to below wherever you initialize Select2.

And now, with a little CSS and JS, and with no modification to Select2's source code, you will have a Select2 plugin that behaves itself much more predictably.