diff --git a/lib/main.js b/lib/main.js index 304608c..b9c8a9b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -87,7 +87,7 @@ // Restore the maxlength value maxLength = elem.getAttribute(ATTR_MAXLENGTH); - if (maxLength) { + if (parseInt(maxLength, 10) >= 0) { // Old FF returns -1 if attribute not set (see GH-56) elem.setAttribute("maxLength", maxLength); elem.removeAttribute(ATTR_MAXLENGTH); }