Skip to content

Commit

Permalink
Make sure the value of maxlength is valid (see #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Allardice committed Nov 29, 2013
1 parent 3fc2b4f commit f8d97cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/main.js
Expand Up @@ -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);
}
Expand Down

0 comments on commit f8d97cd

Please sign in to comment.