Ticket #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: | ||
| Blocking: | Blocked by: |
Description
File : jquery.ui.datepicker.js In function _findPos (line 755)
"jQuery.expr.filters.hidden(obj)" must be added to test hidden text inputs.
| obj.nodeType != 1)) { | |
| obj.nodeType != 1 | jQuery.expr.filters.hidden(obj))) { |
Change History
comment:2 Changed 2 years ago by scott.gonzalez
- Owner set to severin
- Status changed from new to pending
Can you explain the use case for showing a datepicker that is tied to an element that's hidden?
comment:3 Changed 2 years ago by severin
- Status changed from pending to new
HTML :
<input type="text" name="date" class="datepicker" />
CSS :
.datepicker{
display:none;
}
JS :
$('.datepicker').datepicker({showOn:'button'});
comment:4 Changed 2 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 2 years ago by scott.gonzalez
- Status changed from new to open
- Summary changed from Error in datepicker position for hidden text inputs - _findPos() to Datepicker: Treat all hidden text fields the same
comment:6 Changed 2 years ago by Scott González
- Status changed from open to closed
- Resolution set to fixed
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 2 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


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