RESOLVED DUPLICATE of bug 249916 154342
Textarea does not count newlines properly against maxlength
https://bugs.webkit.org/show_bug.cgi?id=154342
Summary Textarea does not count newlines properly against maxlength
Aaron Nance
Reported 2016-02-17 10:40:14 PST
Hard carriage returns are being counted as 2 characters against the maxlength attribute. For example, if you have a textarea with a maxlength="20" and type "0123" and press enter, copy all, and paste as much as you can you'd expect the field to contain: 0123(newline) 0123(newline) 0123(newline) 0123(newline) But what you get is 0123(newline) 0123(newline) 0123(newline) 01 I've added the (newline) to clarify the newline characters. Each newline is being treated as a CR+LF instead of just a LF in the DOM. This seems to be the same as ID 74686, which is marked as fixed, but still appears to be broken.
Attachments
Sam Sneddon [:gsnedders]
Comment 1 2021-08-17 17:58:44 PDT
this recently came up in https://github.com/mdn/browser-compat-data/issues/11988 re bug 74686, as the last comment there shows, the spec here changed in 2016: https://github.com/whatwg/html/commit/163703186794c21daa92cc2718218afa44f26071 (no WPT tests for this, far as I can tell)
Ryosuke Niwa
Comment 3 2023-08-29 00:44:51 PDT
This is indeed addressed by the bug 249916. *** This bug has been marked as a duplicate of bug 249916 ***
Note You need to log in before you can comment on or make changes to this bug.