File tree 2 files changed +3
-2
lines changed 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 460
460
, scrollPos = $ ( window ) . scrollTop ( )
461
461
, heightToTop = pos . top - scrollPos
462
462
, heightToBottom = $ ( window ) . height ( ) - ( heightToTop + controlHeight )
463
- , posTop = heightToTop > heightToBottom
464
- , top = posTop
463
+ , posTop = ( heightToTop > heightToBottom ) && ( settings . keepInViewport == null ? true : settings . keepInViewport )
464
+ , top = posTop
465
465
? pos . top - optionsHeight + borderTopWidth + topPositionCorrelation
466
466
: pos . top + controlHeight - borderBottomWidth - bottomPositionCorrelation ;
467
467
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ $('select').selectBox({
53
53
| topPositionCorrelation | ` 0 ` | Integer | Will be plused to top position if droplist will be show at the top |
54
54
| bottomPositionCorrelation | ` 0 ` | Integer | Will be substracted from top position if droplist will be shown at the bottom |
55
55
| hideOnWindowScroll | ` true ` | Boolean | If false then showed droplist will not hide itself on window scroll event |
56
+ | keepInViewport | ` true ` | Boolean | If set to false, the droplist will be always open towards the bottom |
56
57
57
58
58
59
To specify settings after the init, use this syntax:
You can’t perform that action at this time.
0 commit comments