<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,8 @@ Version 1.1.7
 
  * Solve weird issue with duplicate and missing days in certain time zones (#2984,
    thanks to Arsenicus)
+ * Insert the date picker directly after the input, so that the links in it can be
+   tabbed through. Listen for the Esc key and hide the date picker if it's pressed (#2276)
 
 Version 1.1.6
 -------------</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ function DateInput(el, opts) {
   $.extend(this, DateInput.DEFAULT_OPTS, opts);
   
   this.input = $(el);
-  this.bindMethodsToObj(&quot;show&quot;, &quot;hide&quot;, &quot;hideIfClickOutside&quot;, &quot;selectDate&quot;, &quot;prevMonth&quot;, &quot;nextMonth&quot;);
+  this.bindMethodsToObj(&quot;show&quot;, &quot;hide&quot;, &quot;hideIfClickOutside&quot;, &quot;hideOnEsc&quot;, &quot;selectDate&quot;, &quot;prevMonth&quot;, &quot;nextMonth&quot;);
   
   this.build();
   this.selectDate();
@@ -32,7 +32,7 @@ DateInput.prototype = {
     });
     tableShell += &quot;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;;
     
-    this.dateSelector = this.rootLayers = $('&lt;div class=&quot;date_selector&quot;&gt;&lt;/div&gt;').append(monthNav, tableShell).appendTo(document.body);
+    this.dateSelector = this.rootLayers = $('&lt;div class=&quot;date_selector&quot;&gt;&lt;/div&gt;').append(monthNav, tableShell).insertAfter(this.input);
     
     if ($.browser.msie &amp;&amp; $.browser.version &lt; 7) {
       this.ieframe = $('&lt;iframe class=&quot;date_selector_ieframe&quot; frameborder=&quot;0&quot; src=&quot;#&quot;&gt;&lt;/iframe&gt;').insertBefore(this.dateSelector);
@@ -101,12 +101,14 @@ DateInput.prototype = {
     this.rootLayers.css(&quot;display&quot;, &quot;block&quot;);
     this.setPosition();
     this.input.unbind(&quot;focus&quot;, this.show);
-    $([window, document.body]).click(this.hideIfClickOutside);
+    $(&quot;a:last&quot;, this.dateSelector).blur(this.hide);
+    $([window, document.body]).click(this.hideIfClickOutside).keyup(this.hideOnEsc);
   },
   
   hide: function() {
     this.rootLayers.css(&quot;display&quot;, &quot;none&quot;);
-    $([window, document.body]).unbind(&quot;click&quot;, this.hideIfClickOutside);
+    $([window, document.body]).unbind(&quot;click&quot;, this.hideIfClickOutside).unbind(&quot;keyup&quot;, this.hideOnEsc);
+    $(&quot;a:last&quot;, this.dateSelector).unbind(&quot;blur&quot;, this.hide);
     this.input.focus(this.show);
   },
   
@@ -116,6 +118,12 @@ DateInput.prototype = {
     };
   },
   
+  hideOnEsc: function(event) {
+    if (event.keyCode == 27) {
+      this.hide();
+    };
+  },
+  
   stringToDate: function(string) {
     var matches;
     if (matches = string.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/)) {</diff>
      <filename>jquery.date_input.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>babb08bf699c66ce4adb057c0a1746aa11009489</id>
    </parent>
  </parents>
  <author>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </author>
  <url>http://github.com/jonleighton/date_input/commit/49c3acb67628d91e68ccee3a17b361e5110a509d</url>
  <id>49c3acb67628d91e68ccee3a17b361e5110a509d</id>
  <committed-date>2008-11-01T13:23:43-07:00</committed-date>
  <authored-date>2008-11-01T13:23:43-07:00</authored-date>
  <message>Insert the date picker directly after the input, so that the links in it can be
tabbed through. Listen for the Esc key and hide the date picker if it's pressed (#2276)</message>
  <tree>eda90f381bbef59951d6f74a39ac652e4c0961b2</tree>
  <committer>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </committer>
</commit>
