aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTJ VanToll <tj.vantoll@gmail.com>2013-09-27 13:49:57 -0400
committerTJ VanToll <tj.vantoll@gmail.com>2013-09-27 14:23:07 -0400
commite6360ab846c6d0248d6013d005d2c178906ca692 (patch)
treed65dc70615094e93a9c28b32284ccb2d09e7a37f
parent9ef09edc797566e81f20682ab93208c9076341b5 (diff)
downloadjquery-ui-e6360ab846c6d0248d6013d005d2c178906ca692.tar.gz
jquery-ui-e6360ab846c6d0248d6013d005d2c178906ca692.zip
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
-rw-r--r--ui/jquery.ui.spinner.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index a4912fc7e..3bbd35f88 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -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 );