Skip to content
Permalink
Browse files

Spinner: Don't clear invalid values on blur (but clear the value opti…

…on).
  • Loading branch information
scottgonzalez committed Aug 6, 2011
1 parent 4d2ac1a commit fb5cad37ceb37418d39e1dc1bacceb6ca6413563
Showing with 7 additions and 1 deletion.
  1. +7 −1 ui/jquery.ui.spinner.js
@@ -84,7 +84,13 @@ $.widget( "ui.spinner", {
uiSpinner.addClass( "ui-state-active" );
},
blur: function( event ) {
this.value( this.element.val() );
// don't clear invalid values on blur
var value = this.element.val(),
parsed = this._parse( value );
this.option( "value", parsed );
if ( parsed === null ) {
this.element.val( value );
}
// TODO: is this really correct or just the simplest
// way to keep the active class when pressing the buttons?
// if the mosue is over the text field and the user tabs out

0 comments on commit fb5cad3

Please sign in to comment.
You can’t perform that action at this time.