Skip to content

Commit 9c1780f

Browse files
luisdalmolinscottgonzalez
authored andcommitted
Datepicker: Fixed position problem when input is in a fixed element. Fixes #5626 - DatePicker doesn't work inside fixed div.
(cherry picked from commit 147ec7b)
1 parent fa5e7c1 commit 9c1780f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.datepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,8 @@ $.extend(Datepicker.prototype, {
765765
var dpHeight = inst.dpDiv.outerHeight();
766766
var inputWidth = inst.input ? inst.input.outerWidth() : 0;
767767
var inputHeight = inst.input ? inst.input.outerHeight() : 0;
768-
var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
769-
var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
768+
var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());
769+
var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
770770

771771
offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
772772
offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;

0 commit comments

Comments
 (0)