Skip to content

Commit

Permalink
Datepicker: Fixed position problem when input is in a fixed element. …
Browse files Browse the repository at this point in the history
…Fixes #5626 - DatePicker doesn't work inside fixed div.

(cherry picked from commit 147ec7b)
  • Loading branch information
luisdalmolin authored and scottgonzalez committed Jul 17, 2012
1 parent fa5e7c1 commit 9c1780f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/jquery.ui.datepicker.js
Expand Up @@ -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;
Expand Down

0 comments on commit 9c1780f

Please sign in to comment.