Opened 9 years ago

Last modified 9 years ago

#9495 open bug

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:


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 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

Change History (5)

comment:1 Changed 9 years ago by tj.vantoll

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?

comment:2 Changed 9 years ago by Scott González

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

comment:3 in reply to:  1 Changed 9 years ago by SpoonNZ

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.

comment:4 Changed 9 years ago by tj.vantoll

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.

comment:5 Changed 9 years ago by Scott González

Keywords: rewrite position added
Note: See TracTickets for help on using tickets.