diff --git a/lib/documentListeners.js b/lib/documentListeners.js index f798e3522..a2b6aa68b 100644 --- a/lib/documentListeners.js +++ b/lib/documentListeners.js @@ -20,7 +20,11 @@ function inputIsNumberValue(input) { return (type === 'number' || (type === 'range' && !input.multiple)); } function inputValue(input) { - return inputIsNumberValue(input) ? input.valueAsNumber : input.value; + if (!inputIsNumberValue(input)) + return input.value; + else + return (isFinite(input.valueAsNumber)) ? + input.valueAsNumber : ''; } function addDocumentListeners(doc) {