How to make select2 is opened only downwards?

Hi! In the plugin settings not found, can someone faced with this? How to do that?
July 8th 19 at 16:13
1 answer
July 8th 19 at 16:15
in select2.full.js you need to comment out the following
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
 newDirection = 'above';
 } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
 newDirection = 'below';
 }


on bugs not tested)
no, still the same) - Bobby commented on July 8th 19 at 16:18
only now always opens up) - Bobby commented on July 8th 19 at 16:21
: try to add to this design var forceBelow = typeof this.options.get('forceBelow') != "undefined" ? this.options.get('offsetTop') : false; as in the design add to the condition !forceBelow
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove && !forceBelow) {
newDirection = 'above';
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
newDirection = 'below';
}

now when you initialize forceBelow: true - maggie_Hagenes59 commented on July 8th 19 at 16:24
still also works. - Bobby commented on July 8th 19 at 16:27
: apparently the version of the select is different - maggie_Hagenes59 commented on July 8th 19 at 16:30
: giving installed via bower, I think there the latter had to sacateca. - Bobby commented on July 8th 19 at 16:33

Find more questions by tags JavaScriptHTMLjQuery