mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Spinner: Only format the value when there is one. Fixes #9573 - Spinner: forces a field validation in Firefox before field loses focus or form is submitted
(cherry picked from commit e6360ab846
)
This commit is contained in:
parent
a05cc850e6
commit
b846bea0fd
8
ui/jquery.ui.spinner.js
vendored
8
ui/jquery.ui.spinner.js
vendored
@ -55,8 +55,12 @@ $.widget( "ui.spinner", {
|
|||||||
this._setOption( "min", this.options.min );
|
this._setOption( "min", this.options.min );
|
||||||
this._setOption( "step", this.options.step );
|
this._setOption( "step", this.options.step );
|
||||||
|
|
||||||
// format the value, but don't constrain
|
// Only format if there is a value, prevents the field from being marked
|
||||||
this._value( this.element.val(), true );
|
// as invalid in Firefox, see #9573.
|
||||||
|
if ( this.value() !== "" ) {
|
||||||
|
// Format the value, but don't constrain.
|
||||||
|
this._value( this.element.val(), true );
|
||||||
|
}
|
||||||
|
|
||||||
this._draw();
|
this._draw();
|
||||||
this._on( this._events );
|
this._on( this._events );
|
||||||
|
Loading…
Reference in New Issue
Block a user