From e6360ab846c6d0248d6013d005d2c178906ca692 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Fri, 27 Sep 2013 13:49:57 -0400 Subject: 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 --- ui/jquery.ui.spinner.js | 8 ++++++-- 1 file 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 ); -- cgit v1.2.3