When I'm composing a comment in Firefox (3.5.5) on Windows or Mac, the "characters left" counter below it counts down. When I hit the limit and continue typing, the number goes negative.

Chrome ( and, on the other hand, will not accept any more characters once the number reaches zero. I have to stop mid-sentence to delete earlier text so there's room to complete what I was typing before.

I prefer Firefox's behavior. It lets me finish my thought and then go back afterward to shorten something from earlier. Furthermore, it tells me how much shortening I need to do. I'd like for Chrome to behave the same.

  • what version of Chrome are you using? I can't repro on Chrome or Safari for windows. (i tried safari since it also uses webkit as the rendering engine.)
    – Kip
    Dec 17 '09 at 15:33
  • Same here. Just tried it; when it reaches 0 it stops.
    – alex
    Dec 17 '09 at 15:44
  • Edited to include versions. If I copy and paste a block of text, it even gets truncated at 600 characters. Dec 17 '09 at 15:46
  • I can reproduce the problem with Chrome
    – Michael B.
    Dec 17 '09 at 16:20
  • "I'd like for Chrome to behave the same." I'd like for all the browsers to behave the same, render the same, operate the same, script the same and basically allow the web to act like a unified application platform. I'm not holding my breath. :(
    – John Rudy
    Dec 17 '09 at 17:27
  • Ezekiel, I'm not sure what point you were trying to make. Dec 17 '09 at 17:57
  • Downgrade! Chrome behaves like Firefox. Dec 17 '09 at 18:11
  • I'm upvoting because I agree with the requested change of behaviour. It's much easier to type beyond the limit and then edit down, rather than having to stop immediately once the limit has been reached.
    – Ether
    Dec 17 '09 at 20:51

It looks like the problem is that the textarea has a maxlength property, which isn't part of the textarea spec. Validation fails for a textarea with maxlength property defined.

I guess in the newest version of Chrome (or webkit?) has decided they will support the maxlength property on textareas now. (Or maybe this is something added in HTML5?)

  • Good idea! As it turns out, HTML 5 does have such an attribute. Since it seems that the "characters left" counter implementation doesn't expect the browser to honor that attribute anyway, I think an easy fix for this bug would be to simply remove that attribute. Dec 18 '09 at 3:04
  • well, my guess is that the "n characters left" code uses the maxlength property to determine how many characters are allowed. javascript can still get attributes from the DOM that aren't valid, so it'd have no problem reading that "600" maxlength out of the tag. so that might not be an easy fix, since you'd have to change the javascript to get the maximum length in some other way.
    – Kip
    Dec 18 '09 at 3:07
  • 1
    If the name maxlength was chosen because it's not a valid attribute, then I expect the solution is still easy — simply pick some other name that's used by neither HTML 4 nor 5. To prevent this from breaking again later, it might be wise to use a different namespace, although that probably wouldn't be quite so easy a fix. Dec 28 '09 at 18:54

FYI, we don't formally support unreleased browsers.

No-repro in Chrome 3, the currently released version.

  • 2
    So, when Chrome 4 is released, what's the process? Do I remove the "norepro" tag from this, or do I post something new, despite it being the same bug? Dec 28 '09 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .