From 4affbb8c6be74874795ba30995a72d1c26fcc2d0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 25 Jan 2017 16:11:56 +0000 Subject: [PATCH] Numeric validator that accepts blank should accept undefined --- editor/js/validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/js/validators.js b/editor/js/validators.js index 7b5dc0ff9..833472b24 100644 --- a/editor/js/validators.js +++ b/editor/js/validators.js @@ -14,7 +14,7 @@ * limitations under the License. **/ RED.validators = { - number: function(blankAllowed){return function(v) { return (blankAllowed&&v==='') || (v!=='' && !isNaN(v));}}, + number: function(blankAllowed){return function(v) { return (blankAllowed&&(v===''||v===undefined)) || (v!=='' && !isNaN(v));}}, regex: function(re){return function(v) { return re.test(v);}}, typedInput: function(ptypeName,isConfig) { return function(v) { var ptype = $("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val() || this[ptypeName];