Skip to main content

Search and Top Navigation

#5626 closed bug (fixed)

Opened May 17, 2010 11:11PM UTC

Closed July 17, 2012 08:23PM UTC

Last modified August 13, 2013 08:00PM UTC

DatePicker doesn't work inside fixed div

Reported by: kbwood Owned by:
Priority: minor Milestone: 1.8.22
Component: ui.datepicker Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

Forum: http://forum.jquery.com/topic/datepicker-doesn-t-work-inside-fixed-div.

I tried putting DatePicker inside of a fixed position div that is attached to the bottom of the viewport. When clicking on the input box that should open the calendar, I see in Firebug that the dimensions of the calendar box slide out, but the box doesn't appear where it should above the input. Is this expected? I'm assuming there is some conflict with it being inside a fixed div. And is there any known way to use DatePicker from within a fixed div?

Attachments (0)
Change History (6)

Changed May 17, 2010 11:14PM UTC by kbwood comment:1

Proposed solution:

    _checkOffset: function(inst, offset, isFixed) {
        var dpWidth = inst.dpDiv.outerWidth();
        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 +
            (isFixed ? 0 : $(document).scrollLeft()); // Here
        var viewHeight = document.documentElement.clientHeight +
            (isFixed ? 0 : $(document).scrollTop()); // Here
        ...

Changed May 02, 2011 02:00PM UTC by joehave comment:2

Here's an example of what I believe is the same issue.

http://jsfiddle.net/Yuuws/3/

Changed July 17, 2012 08:23PM UTC by Luis Dalmolin comment:3

resolution: → fixed
status: newclosed

Datepicker: Fixed position problem when input is in a fixed element. Fixes #5626 - DatePicker doesn't work inside fixed div.

Changeset: 147ec7bd624e631fe019973876ad587e85d112bf

Changed July 17, 2012 08:23PM UTC by Luis Dalmolin comment:4

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)

Changeset: 9c1780f640e2c9cbcbca1182989ae511408c04e9

Changed July 17, 2012 08:23PM UTC by scottgonzalez comment:5

milestone: TBD1.8.22

Changed August 13, 2013 08:00PM UTC by tj.vantoll comment:6

#7081 is a duplicate of this ticket.