Device-Bugs icon indicating copy to clipboard operation
Device-Bugs copied to clipboard

textarea maxlength inconsistent with new lines

Open zachleat opened this issue 9 years ago • 0 comments
trafficstars

<textarea maxlength="2">

image

One new line is allowed in Chrome and Safari, but two are allowed in Firefox, Edge, and IE.

Safari has another peculiar behavior in that it seems to round up (?) when new lines are in play. For example: maxlength="1" allows 1; maxlength="2" allows 1; maxlength="3" allows 2, maxlength="4" allows 2; maxlength="5" allows 3, etc.

Relevant browser issues:

  • Webkit (marked as Resolved Fixed): https://bugs.webkit.org/show_bug.cgi?id=74686
  • Blink (marked as Fixed): https://bugs.chromium.org/p/chromium/issues/detail?id=104971
  • Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=702296

JSBin Test case

zachleat avatar Jul 12 '16 19:07 zachleat