From 79f6ea9b1f4c502e2416ea2679bcd18bc6a74756 Mon Sep 17 00:00:00 2001 From: jon Date: Thu, 27 Mar 2014 10:07:23 -0700 Subject: [PATCH] Allow '.', '+.', '+', '-.', and '-' even though without numbers, they cannot be parsed. --- IPython/html/static/widgets/js/widget_int.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/widgets/js/widget_int.js b/IPython/html/static/widgets/js/widget_int.js index 693ac1621..c70477b89 100644 --- a/IPython/html/static/widgets/js/widget_int.js +++ b/IPython/html/static/widgets/js/widget_int.js @@ -214,7 +214,10 @@ define(["widgets/js/widget"], function(WidgetManager){ // Try to parse value as a int. var numericalValue = 0; if (e.target.value !== '') { - numericalValue = this._parse_value(e.target.value); + var trimmed = e.target.value.trim(); + if (!(['-', '-.', '.', '+.', '+'].indexOf(trimmed) >= 0)) { + numericalValue = this._parse_value(e.target.value); + } } // If parse failed, reset value to value stored in model.