From 2860ef316f97dd7b2d3d74e73e1fdeeeece4ea94 Mon Sep 17 00:00:00 2001 From: Osman Mazinov Date: Wed, 18 Jul 2018 18:17:16 +0300 Subject: [PATCH] Patch input --- lib/documentListeners.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/documentListeners.js b/lib/documentListeners.js index c0972f4b6..dcc44972e 100644 --- a/lib/documentListeners.js +++ b/lib/documentListeners.js @@ -21,7 +21,10 @@ function inputIsNumberValue(input) { return (type === 'number' || (type === 'range' && !input.multiple)); } var inputValue = function(input) { - return inputIsNumberValue(input) ? input.valueAsNumber : input.value; + if (!inputIsNumberValue(input)) + return input.value; + else + return (isFinite(input.valueAsNumber)) ? input.valueAsNumber : ''; }; function addDocumentListeners(doc) {