});
test( "Keyboard handling", function() {
- expect( 8 );
+ expect( 9 );
var input = $( "#datepicker" ).datepicker(),
instance = input.datepicker( "instance" ),
date = new Date();
TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
"Keystroke esc - abandoned" );
+ input.val( "1/2/14" )
+ .simulate( "keyup" );
+ TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 2 ),
+ "Picker updated as user types into input" );
+
input.datepicker( "destroy" );
});
break;
}
},
+ keyup: function() {
+ if ( this.isValid() && !this.inline ) {
+ this.date.setTime( this.element.val() ).select();
+ this.refresh();
+ }
+ },
mousedown: function( event ) {
if (this.isOpen) {
suppressExpandOnFocus = true;