From 697c5721da11c6dc848b459f70dacd3ad6d4f486 Mon Sep 17 00:00:00 2001 From: huseyinturkmenoglu Date: Sun, 13 Sep 2020 21:49:38 +0300 Subject: [PATCH] Orientation 'auto' doesn't calculate to correctly #2588 --- js/bootstrap-datepicker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/bootstrap-datepicker.js b/js/bootstrap-datepicker.js index d04ea915f..3dbf4d1eb 100644 --- a/js/bootstrap-datepicker.js +++ b/js/bootstrap-datepicker.js @@ -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(); @@ -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'; } @@ -1706,6 +1707,7 @@ daysOfWeekHighlighted: [], datesDisabled: [], endDate: Infinity, + fixedHeight: 0, forceParse: true, format: 'mm/dd/yyyy', isInline: null,