Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#6988 closed bug (fixed)

Datepicker: Treat all hidden text fields the same

Reported by: severin Owned by: severin
Priority: minor Milestone: 1.8.10
Component: ui.datepicker Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

File : jquery.ui.datepicker.js In function _findPos (line 755)

"jQuery.expr.filters.hidden(obj)" must be added to test hidden text inputs.

while (obj && (obj.type == 'hidden' + while (obj && (obj.type == 'hidden'
obj.nodeType != 1)) {
obj.nodeType != 1 jQuery.expr.filters.hidden(obj))) {

Change History (9)

comment:1 Changed 12 years ago by severin

while (obj && (obj.type == 'hidden' || obj.nodeType != 1 **|| jQuery.expr.filters.hidden(obj)**)) {

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

Owner: set to severin
Status: newpending

Can you explain the use case for showing a datepicker that is tied to an element that's hidden?

comment:3 Changed 12 years ago by severin

Status: pendingnew

HTML :

<input type="text" name="date" class="datepicker" />

CSS :

.datepicker{
    display:none;
}

JS :

$('.datepicker').datepicker({showOn:'button'});

comment:4 Changed 12 years ago by severin

The purpose of this is to display only the button (not the input).

But it's only a design hidden. For most of the views using this componant, the input is displayed, the designer wants to hide it only on one view and he only has CSS to do so.

What happen today : the datepicker pop in the top left corner.

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

Status: newopen
Summary: Error in datepicker position for hidden text inputs - _findPos()Datepicker: Treat all hidden text fields the same

comment:6 Changed 12 years ago by Scott González

Resolution: fixed
Status: openclosed

Datepicker: Properly handle datepickers attached to inputs that are hidden using CSS. Fixes #6988 - Datepicker: Treat all hidden text fields the same. (cherry picked from commit 6fbee255d8d895c7e84a4b2eaad2cfadc8a3425a)

Changeset: cf9dac6c1704150d40191573767e5bfa58dcd9d2

comment:7 Changed 12 years ago by Scott González

Datepicker: Properly handle datepickers attached to inputs that are hidden using CSS. Fixes #6988 - Datepicker: Treat all hidden text fields the same.

Changeset: a3cba34a4d99756e7590fee391fee1bdf06d8a5f

comment:8 Changed 12 years ago by Scott González

Milestone: 1.91.8.10

comment:9 Changed 10 years ago by mikesherov

#5658 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.