Skip to content

Commit

Permalink
Orientation 'auto' doesn't calculate to correctly uxsolutions#2588
Browse files Browse the repository at this point in the history
  • Loading branch information
huseyinturkmenoglu committed Sep 13, 2020
1 parent c42c96b commit 697c572
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@
calendarHeight = this.picker.outerHeight(),
visualPadding = 10,
container = $(this.o.container),
fixedHeight = this.o.fixedHeight,
windowWidth = container.width(),
scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),
appendOffset = container.offset();
Expand Down Expand Up @@ -734,7 +735,7 @@
var yorient = this.o.orientation.y,
top_overflow;
if (yorient === 'auto'){
top_overflow = -scrollTop + top - calendarHeight;
top_overflow = -scrollTop + top - (calendarHeight < 250 ? 250 : calendarHeight) - fixedHeight;
yorient = top_overflow < 0 ? 'bottom' : 'top';
}

Expand Down Expand Up @@ -1706,6 +1707,7 @@
daysOfWeekHighlighted: [],
datesDisabled: [],
endDate: Infinity,
fixedHeight: 0,
forceParse: true,
format: 'mm/dd/yyyy',
isInline: null,
Expand Down

0 comments on commit 697c572

Please sign in to comment.