Skip to main content

Search and Top Navigation

#9495 open bug ()

Opened August 13, 2013 01:58AM UTC

Last modified July 14, 2014 06:43PM UTC

Datepicker: hidden input is positioned incorrectly in fixed div

Reported by: SpoonNZ Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.10.3
Keywords: rewrite position Cc:
Blocked by: Blocking:
Description

If you have a datepicker with a hidden main input (for example, if you're using both an altField and showOn:button), this doesn't position correctly on the page if it is within a fixed element.

The possibility of a hidden main input is considered in places in the code, as is the possibility of a fixed parent, however both in tandem doesn't appear to have been handled correctly.

A JSFiddle showing the problem is available at http://jsfiddle.net/aPrAv/. Scroll down the page a bit - the relatively positioned datepicker appears correctly, however the fixed position one doesn't.

A fix has been submitted to https://github.com/jquery/jquery-ui/pull/1050

Attachments (0)
Change History (5)

Changed August 13, 2013 08:12PM UTC by tj.vantoll comment:1

Hi SpoonNZ,

Thanks for taking the time to contribute to the jQuery UI project. While this is a problem, having a hidden input within a fixed parent definitely seems like an edge case to me. And... switching to use the position utility will take care of this.

Therefore my vote is that we hold off on this, but I'll wait for another opinion. scott.gonzalez?

Changed August 13, 2013 08:20PM UTC by scottgonzalez comment:2

I think if we have a working patch, we should accept it now.

Changed August 13, 2013 09:30PM UTC by SpoonNZ comment:3

Definitely is an edge case, however the strange part is that having the hidden input is specifically catered for elsewhere in the code (a function or two below my patch), so obviously an edge case that has been hit before.

Another very feasible scenario for having the hidden input would be with AJAX - choose a date and it just sends through an AJAX request to load some content. Could very easily see how this wouldn't have the date displayed on screen.

Changed August 14, 2013 12:25PM UTC by tj.vantoll comment:4

status: newopen
summary: Datepicker with hidden input is positioned incorrectly in fixed divDatepicker: hidden input is positioned incorrectly in fixed div

Good points. Regardless of how we end up fixing this I'll mark this as valid.

Changed July 14, 2014 06:43PM UTC by scottgonzalez comment:5

keywords: → rewrite position