Skip to content

Commit e6360ab

Browse files
committed
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
1 parent 9ef09ed commit e6360ab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/jquery.ui.spinner.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ $.widget( "ui.spinner", {
5555
this._setOption( "min", this.options.min );
5656
this._setOption( "step", this.options.step );
5757

58-
// format the value, but don't constrain
59-
this._value( this.element.val(), true );
58+
// Only format if there is a value, prevents the field from being marked
59+
// as invalid in Firefox, see #9573.
60+
if ( this.value() !== "" ) {
61+
// Format the value, but don't constrain.
62+
this._value( this.element.val(), true );
63+
}
6064

6165
this._draw();
6266
this._on( this._events );

0 commit comments

Comments
 (0)