From: Richard D. Worth Date: Tue, 19 Jul 2011 11:59:21 +0000 (-0400) Subject: Datepicker: show inline datepicker setting explicit display:block instead of using... X-Git-Tag: 1.8.15~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c81bfb9815405cd0a1da41ffbfe97bfc0f4ab11b;p=jquery-ui.git Datepicker: show inline datepicker setting explicit display:block instead of using .show() in case it is disconnected. Fixed #7552 - A Datepicker created on a detached div has zero height (cherry picked from commit b8af0d1f7505dd5e56319a11bbd14f1e381b36b9) --- diff --git a/tests/visual/datepicker/datepicker_ticket_7552.html b/tests/visual/datepicker/datepicker_ticket_7552.html new file mode 100644 index 000000000..a78a84818 --- /dev/null +++ b/tests/visual/datepicker/datepicker_ticket_7552.html @@ -0,0 +1,23 @@ + + + + + Datepicker Visual Test : Datepicker ticket #7552 + + + + + + + + + + +

#7552 - A Datepicker created on a detached div has zero height

+ + + diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 19696236c..921f48760 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -285,7 +285,9 @@ $.extend(Datepicker.prototype, { if( inst.settings.disabled ) { this._disableDatepicker( target ); } - inst.dpDiv.show(); + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); }, /* Pop-up the date picker in a "dialog" box.