From 68abc5354a270341bc9160aae90ef1a07dab8b98 2014-11-15 01:04:52 From: Jonathan Frederic Date: 2014-11-15 01:04:52 Subject: [PATCH] Fix #6385 --- diff --git a/IPython/html/static/widgets/js/widget_int.js b/IPython/html/static/widgets/js/widget_int.js index 3fd0ae0..3cac734 100644 --- a/IPython/html/static/widgets/js/widget_int.js +++ b/IPython/html/static/widgets/js/widget_int.js @@ -335,8 +335,10 @@ define([ // Try to parse value as a int. var numericalValue = 0; - if (e.target.value !== '') { - var trimmed = e.target.value.trim(); + var trimmed = e.target.value.trim(); + if (trimmed === '') { + return; + } else { if (!(['-', '-.', '.', '+.', '+'].indexOf(trimmed) >= 0)) { numericalValue = this._parse_value(e.target.value); } @@ -366,7 +368,7 @@ define([ handleChanged: function(e) { // Applies validated input. - if (this.model.get('value') != e.target.value) { + if (e.target.value.trim() === '' || e.target.value !== this.model.get('value')) { e.target.value = this.model.get('value'); } },