]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: show inline datepicker setting explicit display:block instead of using...
authorRichard D. Worth <rdworth@gmail.com>
Tue, 19 Jul 2011 11:59:21 +0000 (07:59 -0400)
committerRichard D. Worth <rdworth@gmail.com>
Tue, 19 Jul 2011 12:12:41 +0000 (08:12 -0400)
(cherry picked from commit b8af0d1f7505dd5e56319a11bbd14f1e381b36b9)

tests/visual/datepicker/datepicker_ticket_7552.html [new file with mode: 0644]
ui/jquery.ui.datepicker.js

diff --git a/tests/visual/datepicker/datepicker_ticket_7552.html b/tests/visual/datepicker/datepicker_ticket_7552.html
new file mode 100644 (file)
index 0000000..a78a848
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <meta charset="UTF-8" />
+       <title>Datepicker Visual Test : Datepicker ticket #7552</title>
+       <link rel="stylesheet" href="../visual.css" type="text/css" />
+       <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
+       <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
+       <script type="text/javascript">
+       $(function() {
+               $('<div></div>').datepicker().appendTo("body");
+       });
+       </script>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/7552">#7552 - A Datepicker created on a detached div has zero height</a></h1>
+
+</body>
+</html>
index 19696236cb60cfe8ece83d776b22297771583833..921f48760b7ee2b1444105d7807ca1448d6906cf 100644 (file)
@@ -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.