From b8af0d1f7505dd5e56319a11bbd14f1e381b36b9 Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Tue, 19 Jul 2011 07:59:21 -0400 Subject: [PATCH] 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 --- .../datepicker/datepicker_ticket_7552.html | 23 +++++++++++++++++++ ui/jquery.ui.datepicker.js | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/visual/datepicker/datepicker_ticket_7552.html 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 aeadde4ee..87f9bd950 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.