diff --git a/bootstrap-touchspin.jquery.json b/bootstrap-touchspin.jquery.json index 7a99065..241d623 100644 --- a/bootstrap-touchspin.jquery.json +++ b/bootstrap-touchspin.jquery.json @@ -10,7 +10,7 @@ "spinbutton", "spinner" ], - "version": "2.7.0", + "version": "2.7.1", "author": { "name": "István Ujj-Mészáros", "url": "https://github.com/istvan-ujjmeszaros" diff --git a/bootstrap-touchspin/bootstrap.touchspin.js b/bootstrap-touchspin/bootstrap.touchspin.js index 9e92326..25683ed 100644 --- a/bootstrap-touchspin/bootstrap.touchspin.js +++ b/bootstrap-touchspin/bootstrap.touchspin.js @@ -3,7 +3,7 @@ /*!========================================================================= * Bootstrap TouchSpin - * v2.7.0 + * v2.7.1 * * A mobile and touch friendly input spinner component for Bootstrap 3. * @@ -138,8 +138,12 @@ _updateSettings(newsettings); _checkValue(); - var value = Number(elements.input.val()); - elements.input.val(value.toFixed(settings.decimals)); + var value = elements.input.val(); + + if (value !== "") { + value = Number(elements.input.val()); + elements.input.val(value.toFixed(settings.decimals)); + } } function _initSettings() {