From 9c1780f640e2c9cbcbca1182989ae511408c04e9 Mon Sep 17 00:00:00 2001 From: Luis Dalmolin Date: Mon, 16 Jul 2012 09:54:48 -0300 Subject: [PATCH] Datepicker: Fixed position problem when input is in a fixed element. Fixes #5626 - DatePicker doesn't work inside fixed div. (cherry picked from commit 147ec7bd624e631fe019973876ad587e85d112bf) --- ui/jquery.ui.datepicker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 51d1b183b..1c94d61fd 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -765,8 +765,8 @@ $.extend(Datepicker.prototype, { var dpHeight = inst.dpDiv.outerHeight(); var inputWidth = inst.input ? inst.input.outerWidth() : 0; var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); - var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; -- 2.39.5