Skip to content

Commit

Permalink
Spinner: Only format the value when there is one. Fixes #9573 - Spinn…
Browse files Browse the repository at this point in the history
…er: forces a field validation in Firefox before field loses focus or form is submitted

(cherry picked from commit e6360ab)
  • Loading branch information
tjvantoll authored and scottgonzalez committed Nov 26, 2013
1 parent a05cc85 commit b846bea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/jquery.ui.spinner.js
Expand Up @@ -55,8 +55,12 @@ $.widget( "ui.spinner", {
this._setOption( "min", this.options.min );
this._setOption( "step", this.options.step );

// format the value, but don't constrain
this._value( this.element.val(), true );
// Only format if there is a value, prevents the field from being marked
// 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._on( this._events );
Expand Down

0 comments on commit b846bea

Please sign in to comment.