mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Spinner: Don't clear invalid values on blur (but clear the value option).
This commit is contained in:
parent
4d2ac1abca
commit
fb5cad37ce
8
ui/jquery.ui.spinner.js
vendored
8
ui/jquery.ui.spinner.js
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user