Skip to content

Commit 147ec7b

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.
1 parent cb44dc6 commit 147ec7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.datepicker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ $.extend(Datepicker.prototype, {
766766
var dpHeight = inst.dpDiv.outerHeight();
767767
var inputWidth = inst.input ? inst.input.outerWidth() : 0;
768768
var inputHeight = inst.input ? inst.input.outerHeight() : 0;
769-
var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
770-
var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
769+
var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());
770+
var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
771771

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

0 commit comments

Comments
 (0)